// 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 simplepopup(url,width,height) {
	winl = (screen.width) ? (screen.width - width) / 2 : 0;
	wint = (screen.height) ? (screen.height - height) / 2 : 0;
	var settings = 'left='+winl+',top='+wint+',width='+(width+40)+',height='+(height+40)+',toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=no';
	var wnd = window.open(url,'imgpoint',settings);
	wnd.focus();
}

function emptypopup (name,width,height) {
	winl = (screen.width) ? (screen.width - width) / 2 : 0;
	wint = (screen.height) ? (screen.height - height) / 2 : 0;
	var settings = 'left='+winl+',top='+wint+',width='+width+',height='+height+',toolbar=no,menubar=no,status=yes,scrollbars=no,resizable=no';
	window.open('about:blank',name,settings);
}

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 = base_path + 'img/' + a[i];
		}
	}
}
/*
function addEvent(obj, eventType,fn, useCapture) {
if (obj.addEventListener) {
obj.addEventListener(eventType, fn, useCapture);
return true;
} else {
if (obj.attachEvent) {
var r = obj.attachEvent("on"+eventType, fn);
return r;
}
}
}
*/

function $(element) {
	if (arguments.length > 1) {
		for (var i = 0, elements = [], length = arguments.length; i < length; i++)
		elements.push($(arguments[i]));
		return elements;
	}
	if (typeof element == 'string')
	element = document.getElementById(element);
	return element;
}


function setCookie(name, value, expires, path, domain, secure) {
	var curCookie = name + "=" + escape(value) +((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");

	document.cookie = curCookie;
}

// name - имя считываемого cookie

function getCookie(name) {
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1) return null;
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}


// name - имя cookie
// [path] - путь, для которого cookie действительно
// [domain] - домен, для которого cookie действительно

function deleteCookie(name, path, domain) {
	if (getCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT"
	}
}


var __eventListeners = [];

function addEvent(instance, eventName, listener) {
	var listenerFn = listener;
	if (instance.addEventListener) {
		instance.addEventListener(eventName, listenerFn, false);
	} else if (instance.attachEvent) {
		listenerFn = function() {
			listener(window.event);
		}
		instance.attachEvent("on" + eventName, listenerFn);
	} else {
		throw new Error("Event registration not supported");
	}
	var event = {
		instance: instance,
		name: eventName,
		listener: listenerFn
	};
	__eventListeners.push(event);
	return event;
}
/* * * * * * * * * * * * * * * * */
function removeEvent(obj,evt,fn) {
	if (obj.removeEventListener)
	obj.removeEventListener(evt,fn,false);
	else if (obj.detachEvent)
	obj.detachEvent('on'+evt,fn);
}
/* * * * * * * * * * * * * * * * */
function unregisterAllEvents() {
	while (__eventListeners.length > 0) {
		removeEventListener(__eventListeners[0]);
	}
}
/* * * * * * * * * * * * * * * * */
function getTargetElement(evt) {
	var elem;
	if (evt.target) {
		elem = (evt.target.nodeType == 3) ? evt.target.parentNode : evt.target;
	} else {
		elem = evt.srcElement;
	}
	return elem;

}
/* * * * * * * * * * * * * * * * */
function popupimg(name, url, width, height){
	var imgss;
	winl = (screen.width) ? (screen.width - width) / 2 : 0;
	wint = (screen.height) ? (screen.height - height) / 2 : 0;
	//var winname = urlencode(name);
	var winname = name;
	var settings = 'left='+winl+',top='+wint+',width='+(width+40)+',height='+(height+40)+',toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes';
	myimgss = window.open('','imgpoint',settings);
	myimgss.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><title>'+urldecode(winname)+'</title></head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table height="100%" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle"><a href="javascript:self.close();"><img src="'+url+'" name="fullbimg" alt="Click to close the window..." width="'+width+'" height="'+height+'" border="0"></a></td></tr></table></body></html>');
	myimgss.document.close();
	if(myimgss.window.focus) {
		myimgss.window.focus();
	}
}
/* * * * * * * * * * * * * * * * */
function urlencode(ch) {
	ch = escape(ch);
	ch = ch.replace(/[ ]/g,"%20");
	ch = ch.replace(/\+/g,"%2B");
	return ch;
}
function urldecode(ch) {
	ch = ch.replace(/[+]/g," ");
	return unescape(ch);
}
/* * * * * * * * * * * * * * * * */
function cPanels (id,active) {
	this.active = active;
	this.activeLink = null;
	this.ID = id;
	this.root = document.getElementById(id);
	this.childs = [];
	this.bookmarks = null;
	this.init = function (activeLink) {
		var i,j;
		if (this.root) {
			var elements = this.root.getElementsByTagName('div');
			if (elements) {
				j = 0;
				for (i in elements) {
					if (elements[i].className && (elements[i].className.indexOf('ptab') != -1)) {
						if (j == this.active) {
							elements[i].style.display = 'block';
							if (activeLink) {
								activeLink.className = 'selected';
								this.activeLink = activeLink;
							}
						}
						this.childs[j] = elements[i];
						j++;

					} else if(elements[i].className && (elements[i].className.indexOf('bookmarks') != -1)) {
						this.bookmarks = new cBookmarks(elements[i].id,this.active);
						this.bookmarks.init();
					}
				}
				this.total = j;
			}
		}
	}
	this.activate = function (pIndex,link) {
		if (this.childs[this.active]) {
			this.childs[this.active].style.display = 'none';
			if (this.bookmarks && this.bookmarks[this.active]) {
				this.bookmarks[this.active].id = '';
			}
			if (this.activeLink) {
				this.activeLink.className = '';
			}

		}
		if (this.childs[pIndex]) {
			this.childs[pIndex].style.display = 'block';
			this.active = pIndex;
			this.activeLink = link;
			if (this.activeLink) {
				this.activeLink.className = 'selected';
			}
			/*
			if (this.bookmarks[pIndex]) {
			this.bookmarks[pIndex].id = 'bmsel';
			}
			*/
			if (this.bookmarks) this.bookmarks.activate(pIndex);
		}
	}

	this.initRoot = function (obj) {
		this.root = obj;
		this.init();
	}
}

/* * * * * * * * * * * * * * * * */
function getOffsetLeft(el) {
	var left = el.offsetLeft;
	if (el.offsetParent) left += getOffsetLeft(el.offsetParent);
	return left;
}
/* * * * * * * * * * * * * * * * */
function getOffsetTop(el) {
	var top = el.offsetTop;
	//alert(el.nodeName + ' class:' + el.className + ' offset:' + el.offsetTop);
	if (el.offsetParent) top += getOffsetTop(el.offsetParent);
	return top;
}

/* * * * * * * * * * * * * * * * */
function validateform(fi,errormsg) {
	var el,noerr;
	noerr = true;
	for (var i in fi) {
		el = document.onfrm[fi[i]];
		if (el) {
			if (el.value == '') {
				noerr = false;
				el.style.background = '#ffdddd';
			} else {
				el.style.background = '#ffffff';
			}
		}
	}
	if (!noerr) alert(errormsg);
	return noerr;
}

/* * * * * * * * * * * * * * * * */
function setLang(lang) {
	var link = location.href;
	var preg = /^http:\/\/(\w{2,3}\.)?(.+)/;
	var rez;
	if (rez = link.match(preg)) {
		location.href = 'http://' + lang + '.' + rez[2];
	}


}
/* * * * * * * * * * * * * * * * */
function getPageScroll(){
	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll)
	return arrayPageScroll;
}

/* * * * * * * * * * * * * * * * */
function getPageSize(){

	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}
/* * * * * * * * * * * * * * * * */
function printPage(mode) {
	if ((mode == undefined) || (mode != 1)) {
		var wint = (screen.height - 600) / 2;
		var winl = (screen.width - 800) / 2;
		var url = location.href + '?print';
		window.open(url, 'Print', 'left='+winl+',top='+wint+',width=800,height=600,toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=no,location=no');
	} else {
		window.print();
	}
	return false;
}

/* * * * * * * * * * * * * * * * */
var dd_u = "undefined";

function WZDD()
{
	this.elements = new Array(0);
	this.obj = null;
	this.n = navigator.userAgent.toLowerCase();
	this.db = (document.compatMode && document.compatMode.toLowerCase() != "backcompat")?
	document.documentElement
	: (document.body || null);
	this.op = !!(window.opera && document.getElementById);
	if(this.op) document.onmousedown = new Function('e',
	'if(((e = e || window.event).target || e.srcElement).tagName == "IMAGE") return false;');
	this.ie = !!(this.n.indexOf("msie") >= 0 && document.all && this.db && !this.op);
	this.iemac = !!(this.ie && this.n.indexOf("mac") >= 0);
	this.ie4 = !!(this.ie && !document.getElementById);
	this.n4 = !!(document.layers && typeof document.classes != dd_u);
	this.n6 = !!(typeof window.getComputedStyle != dd_u && typeof document.createRange != dd_u);
	this.w3c = !!(!this.op && !this.ie && !this.n6 && document.getElementById);
	this.ce = !!(document.captureEvents && document.releaseEvents && !this.n6);
	this.px = this.n4? '' : 'px';
	this.tiv = this.w3c? 40 : 10;
}

var dd = new WZDD();

dd.Int = function(d_x, d_y)
{
	return isNaN(d_y = parseInt(d_x))? 0 : d_y;
};

dd.getScrollX = function()
{
	return dd.Int(window.pageXOffset || (dd.db? dd.db.scrollLeft : 0));
};
dd.getScrollY = function()
{
	return dd.Int(window.pageYOffset || (dd.db? dd.db.scrollTop : 0));
};

dd.evt = function(d_e)
{
	this.but = (this.e = d_e || window.event).which || this.e.button || 0;
	this.button = (this.e.type == 'mousedown')? this.but
	: (dd.e && dd.e.button)? dd.e.button
	: 0;
	this.src = this.e.target || this.e.srcElement || null;
	this.src.tag = ("" + (this.src.tagName || this.src)).toLowerCase();
	this.x = dd.Int(this.e.pageX || this.e.clientX || 0);
	this.y = dd.Int(this.e.pageY || this.e.clientY || 0);
	if(dd.ie)
	{
		this.x += dd.getScrollX() - (dd.ie && !dd.iemac)*1;
		this.y += dd.getScrollY() - (dd.ie && !dd.iemac)*1;
	}
	this.modifKey = this.e.modifiers? this.e.modifiers&Event.SHIFT_MASK : (this.e.shiftKey || false);
};
/* * * * * * * * * * * * * * * * */
function cScroller () {//states: 1 - down , -1 - up , -2 - right , 2 - left
	this.objects = {};
	this.speed = 10;

	this.init = function (objID,state) {
		var obj = {};
		obj.obj = document.getElementById(objID);
		obj.state = state;
		obj.timer = null;
		obj.maxVertScroll = parseInt(obj.obj.scrollHeight) - parseInt(obj.obj.offsetHeight);
		obj.maxHorizScroll = (parseInt(obj.obj.scrollWidth) - parseInt(obj.obj.offsetWidth));
		this.objects[objID] = obj;
	}

	this.down = function (id,timer) {
		if (this.objects[id] == undefined) {
			this.init(id,1);
		}
		var obj = this.objects[id];
		if (timer == undefined) {
			obj.state = 1;
		}

		if ((obj.maxVertScroll > obj.obj.scrollTop) && (obj.state == 1)) {
			obj.obj.scrollTop = (obj.obj.scrollTop + this.speed);
			obj.timer = setTimeout(this.down.bind(this,id,true),100);
		}

	}

	this.right = function (id,timer) {
		if (this.objects[id] == undefined) {
			this.init(id,-2);
		}
		var obj = this.objects[id];
		if (timer == undefined) {
			obj.state = -2;
		}

		if ((obj.maxHorizScroll > obj.obj.scrollLeft) && (obj.state == -2)) {
			obj.obj.scrollLeft = (parseInt(obj.obj.scrollLeft) + this.speed);
			obj.timer = setTimeout(this.right.bind(this,id,true),100);
		}

	}


	this.up = function (id,timer) {
		if (this.objects[id] == undefined) {
			this.init(id,-1);
		}
		var obj = this.objects[id];
		if (timer == undefined) {
			obj.state = -1;
		}

		if ((obj.obj.scrollTop > 0) && (obj.state == -1)) {
			obj.obj.scrollTop = (parseInt(obj.obj.scrollTop) - this.speed);
			if (obj.obj.scrollTop < 0) obj.obj.scrollTop = 0;
			obj.timer = setTimeout(this.up.bind(this,id,true),100);
		}
	}


	this.left = function (id,timer) {
		if (this.objects[id] == undefined) {
			this.init(id,2);
		}
		var obj = this.objects[id];
		if (timer == undefined) {
			obj.state = 2;
		}

		if ((obj.obj.scrollLeft > 0) && (obj.state == 2)) {
			obj.obj.scrollLeft = (parseInt(obj.obj.scrollLeft) - this.speed);
			if (obj.obj.scrollLeft < 0) obj.obj.scrollLeft = 0;
			obj.timer = setTimeout(this.left.bind(this,id,true),100);
		}
	}

	this.stop = function (id) {
		if (this.objects[id]) {
			clearTimeout(this.objects[id].timer);
			this.objects[id].state = 0;
		}
	}



}
/* * * * * * * * * * * * * * * * */
var hiddenBlocks = {};

function setBlock(id,mode) {
	if (hiddenBlocks[id] == undefined) {
		hiddenBlocks[id] = document.getElementById(id);
	}
	var disp = mode ? 'block' : 'none';
	if (hiddenBlocks[id]) hiddenBlocks[id].style.display = disp;
}

/* * * * * * * * * * * * * * * * */
function clearTable(table) {
	if (table && table.tBodies) {
		while(table.tBodies.length > 0) {
			table.removeChild(table.tBodies[0]);
		}
	}
}
/* * * * * * * * * * * * * * * * */
function clearNode(node) {
	if (node.childNodes) {
		while(node.childNodes.length > 0) {
			node.removeChild(node.childNodes[0]);
		}
	}
}
/* * * * * * * * * * * * * * * * */
function fmtNumberEx(n,decimals)
{
	var number = new Number(n);
	var num = number.toFixed(decimals).split('.');
	var newNum = "";
	var result = num[0];
	var remainder;
	while (result > 0)
	{
		result = Math.floor(num[0]/1000);
		remainder = num[0]%1000;
		num[0] = result;
		if (remainder < 1000) {remainder = ' ' + remainder;}
		newNum = "" + remainder + newNum;
	}
	return newNum + '.' + num[1];
}
/* * * * * * * * * * * * * * * * */
/* * * * * * * * * * * * * * * * */
function fmtNumber(number, decimals, point, separator)
{
	if(!isNaN(number))
	{
		point = point ? point : '.';
		number = number.toString().split('.');
		separator = separator ? separator : ' ';
		if(separator)
		{
			var tmp_number = new Array();
			for(var i = number[0].length, j = 0; i > 0; i -= 3)
			{
				var pos = i > 0 ? i - 3 : i;
				tmp_number[j++] = number[0].substring(i, pos);
			}
			number[0] = tmp_number.reverse().join(separator);
		}
		if(decimals && number[1]) {
			//number[1] = Math.round(parseFloat(number[1].substr(0, decimals) + '.' + number[1].substr(decimals, number[1].length), 10));
			//number[1] = Math.round(parseFloat(number[1].substr(0, decimals) + '.' + number[1].substr(decimals, number[1].length), 10));
		} else {
			number.push('00');
		}
		return(number.join(point));
	}
	else return(null);
}
/* * * * * * * * * * * * * * * * */
function cBubbleBlock () {
	this.blocks = {};
	this.timers = {};
	this.inited = false;
	this.init = function () {
		var elems = document.getElementsByTagName('div');
		for (var i = 0; i < elems.length; i++) {
			if (elems[i].className && elems[i].className.match(/bubble/i))	{
				if (!elems[i].id) elems[i].id = 'bubble_' + i;				
				addEvent(elems[i],'mouseover',this.over.bindAsEventListener(this,elems[i].id));
				addEvent(elems[i],'mouseout',this.out.bindAsEventListener(this,elems[i].id));
				this.blocks[elems[i].id] = elems[i];
			}
		}
		this.inited = true;
	}

	this.over = function (e,id) {
		if (!this.inited) this.init();
		if (this.blocks[id]) {
			if (this.timers[id]) {
				clearTimeout(this.timers[id]);
				this.timers[id] = false;
			}
			this.blocks[id].style.display = 'block';
		}
	}

	this.out = function (e,id,mode) {
		if (!this.inited) this.init();
		if (this.blocks[id]) {
			if (this.timers[id]) {
				clearTimeout(this.timers[id]);
				this.timers[id] = false;
			}
			if (mode == undefined)
			{
				this.timers[id] = setTimeout(this.out.bind(this,false,id,true),2000);
			} else {
				this.blocks[id].style.display = 'none';
			}
		}
	}

}
/* * * * * * * * * * * * * * * * */
function cLangMaster (lang,labels) {
	this.lang = lang||'ru';
	this.labels = labels||{};
	this.setLabel = function(label,value) {this.labels[label] = value};
	this.setLabels = function(labels) { this.labels = labels};
	this.getLabel = function(label) {return this.labels[label]||''};
}
/* * * * * * * * * * * * * * * * */
function syncList(){}
syncList.prototype.sync = function(selectors , lang) {
        var el;        
	for (var i=0; i < selectors.length-1; i++) {

            if (el = $(selectors[i])) {
                //addEvent(el,'change',(function (o,id1,id2){return function(){o._sync(id1,id2);};})(this, selectors[i], selectors[i+1]));
                $(selectors[i]).onchange = (function (o,id1,id2){return function(){o._sync(id1,id2);};})(this, selectors[i], selectors[i+1]);
            } 

            
        }
        this.lang = lang || 'ru';
	$(selectors[0]).onchange();
}
syncList.prototype._sync = function (firstSelectId, secondSelectId)
{
	var firstSelect = $(firstSelectId);
	var secondSelect = $(secondSelectId);
        if (firstSelect && secondSelect) {
            secondSelect.length = 0;
            //24:{ru:"Черниговская"},25:{ru:"Черновицкая"}},3:{1:{ru:"Киев",par:10},2:{ru:"Борисполь",par:10}
            //list_id:{value_id:{ru:"title",par:10}}}
            if (firstSelect.length>0) {
                    var parentOpt = firstSelect.value;                    
                    if (parentOpt > 0 && this.dataList) {                        
                        for (var key in this.dataList) {                            
                            if (this.dataList[key].par == parentOpt) secondSelect.options[secondSelect.length] = new Option(this.dataList[key][this.lang], key);
                        }

                    }

            }
            //если второй (подчиненный) селект имеет в свою очередь свои подчиненные селекты (те, для которых он главный),
            //то запускаем его обработчик onchange, чтобы изменить его подчиненные селекты
            secondSelect.onchange && secondSelect.onchange();
        }
};


var MAX_DUMP_DEPTH = 10;



function dumpObj(obj, name, indent, depth) {

      if (depth > MAX_DUMP_DEPTH) {

             return indent + name + ": <Maximum Depth Reached>\n";

      }

      if (typeof obj == "object") {

             var child = null;

             var output = indent + name + "\n";

             indent += "\t";

             for (var item in obj)

             {

                   try {

                          child = obj[item];

                   } catch (e) {

                          child = "<Unable to Evaluate>";

                   }

                   if (typeof child == "object") {

                          output += dumpObj(child, item, indent, depth + 1);

                   } else {

                          output += indent + item + ": " + child + "\n";

                   }

             }

             return output;

      } else {

             return obj;

      }

}
var PT_TEXT = 1;
var PT_CHECKBOX = 2;
var PT_LIST = 3;
var PT_DATE = 4;
var PT_FILE = 5;
var PT_CUSTOM = 6;
var PT_NUMBER = 7;

//flags
var PF_ACTIVE = 1;
var PF_MANDATORY = 2;
var PF_TEXT = 4;
var PF_MULTISELECT = 8;
var PF_MULTILANG = 16;
var PF_NOFORM = 32;
var PF_HIDDEN = 64;
var PF_SELECT = 128;
var PF_REL_OR = 256;
var PF_COOKIE = 512;
var PF_QUICKFILTER = 1024;
var PF_MODULELIST = 2048;
var PF_SCREENSHOT = 4096;



//rule types

//rules  (duplicate in validate.js !!! )
var PR_NUMERIC = 1;
var PR_REGEXP = 2;
var PR_MIN = 3;
var PR_MAX = 4;
var PR_NOTEMPTY = 5;
var PR_MINLENGTH = 6;
var PR_MAXLENGTH = 7;
var PR_EMAIL = 8;

//property ACTIONS
var PA_LOCATION = 1;
var PA_SETFIELD = 2;
var PA_SCREENSHOT = 3;
//

var pSetLists = {};


///images


var Class = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }
}
/* * * * * * * * * * * * * * * * * * * * * */
function emptyFunction() {}
/* * * * * * * * * * * * * * * * * * * * * */
var Try = {
  these: function() {
    var returnValue;

    for (var i = 0, length = arguments.length; i < length; i++) {
      var lambda = arguments[i];
      try {
        returnValue = lambda();
        break;
      } catch (e) {}
    }

    return returnValue;
  }
}
/* * * * * * * * * * * * * * * * * * * * * */
/* * * * * * * * * * * * * * * * * * * * * */
var $A = function(iterable) {
  if (!iterable) return [];

  var results = [];
  for (var i = 0, length = iterable.length; i < length; i++) results.push(iterable[i]);
  return results;

}
/* * * * * * * * * * * * * * * * * * * * * */
Function.prototype.bind = function() {
  var __method = this, args = $A(arguments), object = args.shift();
  return function() {
    return __method.apply(object, args.concat($A(arguments)));
  }
}

Function.prototype.bindAsEventListener = function(object) {
  var __method = this, args = $A(arguments), object = args.shift();
  return function(event) {
    return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments)));
  }
}
/* * * * * * * * * * * * * * * * * * * * * */

Object.extend = function(destination, source) {
  for (var property in source) {
    destination[property] = source[property];
  }
  return destination;
}
/* * * * * * * * * * * * * * * * * * * * * */
var Ajax = {
  getTransport: function() {
    return Try.these(
      function() {return new XMLHttpRequest()},
      function() {return new ActiveXObject('Msxml2.XMLHTTP')},
      function() {return new ActiveXObject('Microsoft.XMLHTTP')}
    ) || false;
  },

  activeRequestCount: 0
}

Ajax.Base = function() {};
Ajax.Base.prototype = {
  setOptions: function(options) {
    this.options = {
      method:       'post',
      asynchronous: true,
      contentType:  'application/x-www-form-urlencoded',
      encoding:     'utf8',
      parameters:   ''
    }
    Object.extend(this.options, options || {});

    this.options.method = this.options.method.toLowerCase();
  }
}

Ajax.Request = Class.create();
Ajax.Request.Events =
  ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];

Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
  _complete: false,

  initialize: function(url, options) {
    this.transport = Ajax.getTransport();
    this.setOptions(options);
    this.request(url);
  }
});
/* * * * * * * * * * * * * * * * * * * * * */

Ajax.Responders = {
  responders: [],

  include: function(responder) {
  	for (var i = 0; i < this.responders.length ; i++) {
  		if (responder == this.responders[i]) return true;
  	}
  	return false;
  },

  register: function(responder) {
	  if (!this.include(responder)) this.responders.push(responder);
  },

  unregister: function(responder) {
    this.responders = this.responders.without(responder);
  },

  dispatch: function(callback, request, transport) {
  	var responder;
    for (var i = 0; i < this.responders.length; i++) {
      responder = this.responders[i];
      if (typeof responder[callback] == 'function') {
        try {
          responder[callback].apply(responder, [request, transport]);
        } catch (e) {}
      }
    }
  }
}

Ajax.Responders.register({
  onCreate: function() {
    Ajax.activeRequestCount++;


  },
  onComplete: function() {
    Ajax.activeRequestCount--;
  }
});

/* * * * * * * * * * * * * * * * * * * * * */


/* * * * * * * * * * * * * * * * * * * * * */

Ajax.Request = Class.create();
Ajax.Request.Events =
  ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];

Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
  _complete: false,

  initialize: function(url, options) {
    this.transport = Ajax.getTransport();
    this.setOptions(options);
    this.request(url);
  },

  request: function(url) {
    this.url = url;
    this.method = this.options.method;
    var params = this.options.parameters;

    if (params && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_='

    try {
      Ajax.Responders.dispatch('onCreate', this, this.transport);

      this.transport.open(this.method.toUpperCase(), this.url, this.options.asynchronous,this.options.username,this.options.password);

      if (this.options.asynchronous) setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10);

      this.transport.onreadystatechange = this.onStateChange.bind(this);
      this.setRequestHeaders();

      var body = this.method == 'post' ? (this.options.postBody || params) : null;


      if (this.options.timeout) {
      	this.timeOut = setTimeout(this.requestTimeout.bind(this),this.options.timeout*1000);
      }


      this.transport.send(body);
    }
    catch (e) {
      this.dispatchException(e);
    }
  },

  requestTimeout: function () {
  	 var transport = this.transport, json = this.evalJSON();
	  if (transport.abort) transport.abort();
	  if (this.options.onFailure) {
			this.options.onFailure(transport,json);
	  }
  },

  onStateChange: function() {
    var readyState = this.transport.readyState;
    if (readyState > 1 && !((readyState == 4) && this._complete))
      this.respondToReadyState(this.transport.readyState);
  },

  setRequestHeaders: function() {
    var headers = {
      'X-Requested-With': 'XMLHttpRequest',
      'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
    };

    if (this.method == 'post') {
      headers['Content-type'] = this.options.contentType +
        (this.options.encoding ? '; charset=' + this.options.encoding : '');

      /* Force "Connection: close" for older Mozilla browsers to work
       * around a bug where XMLHttpRequest sends an incorrect
       * Content-length header. See Mozilla Bugzilla #246651.
       */
      if (this.transport.overrideMimeType &&
          (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
            headers['Connection'] = 'close';
    }

    for (var name in headers)
      this.transport.setRequestHeader(name, headers[name]);
  },

  success: function() {
    return !this.transport.status
        || (this.transport.status >= 200 && this.transport.status < 300);
  },

  respondToReadyState: function(readyState) {
    var state = Ajax.Request.Events[readyState];
    var transport = this.transport, json = this.evalJSON();

    if (state == 'Complete') {
      try {
      	if (this.timeOut) clearTimeout(this.timeOut);
        this._complete = true;
        (this.options['on' + this.transport.status]
         || this.options['on' + (this.success() ? 'Success' : 'Failure')]
         || emptyFunction)(transport, json);
      } catch (e) {
        this.dispatchException(e);
      }
    }

    try {
      (this.options['on' + state] || emptyFunction)(transport, json);
      Ajax.Responders.dispatch('on' + state, this, transport, json);
    } catch (e) {
      this.dispatchException(e);
    }

    if (state == 'Complete') {
      // avoid memory leak in MSIE: clean up

      this.transport.onreadystatechange = emptyFunction;
    }
  },

  getHeader: function(name) {
    try {
      return this.transport.getResponseHeader(name);
    } catch (e) { return null }
  },

  evalJSON: function() {
    try {
      var json = this.getHeader('X-JSON');
      return json ? eval('(' + json + ')') : null;
    } catch (e) { return null }
  },

  evalResponse: function() {
    try {
      return eval(this.transport.responseText);
    } catch (e) {
      this.dispatchException(e);
    }
  },

  dispatchException: function(exception) {
    (this.options.onException || emptyFunction)(this, exception);
    Ajax.Responders.dispatch('onException', this, exception);
  }
});
var currentLBEl = null;
var selectBuff = null;
var imgs = [];
/* * * * * * * * * * * * * * * * */
function showLightBox(elID) {
	var objOverlay = document.getElementById('overlay');
	if (!objOverlay) {
		objOverlay = document.createElement('div');
		objOverlay.id = 'overlay';
		addEvent(objOverlay,'click',hideLightBox);
		objOverlay.innerHTML = '&nbsp;';
		document.body.appendChild(objOverlay);
	}
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();

	objOverlay.style.height = (arrayPageSize[1] + 'px');
	//objOverlay.style.width = (arrayPageSize[0] + 'px');
	objOverlay.style.width = (document.body.clientWidth + 'px');

	if (currentLBEl) {
		srcEl = document.getElementById(currentLBEl);
		if (srcEl) {
			srcEl.style.display = 'none';
		}
	}

	srcEl = document.getElementById(elID);
	if (srcEl) {
		srcEl.style.visibility = 'hidden';
		srcEl.style.display = 'block';
		var height = srcEl.clientHeight;
		var width = srcEl.clientWidth;
		var ttop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - height) / 2);
		
		if (ttop < 0) ttop = 5;
		
		srcEl.style.top = ttop + 'px';
		srcEl.style.left = (((arrayPageSize[0] - 20 - width) / 2) + 'px');
		srcEl.style.visibility = 'visible';
	}
	currentLBEl = elID;

	if (!selectBuff) {
		selectBuff = document.getElementsByTagName('select');
	}
	var vselects = srcEl.getElementsByTagName('select');
	var i,j,flag;
	for (i = 0;i < selectBuff.length;i++) {
		flag = 'hidden';
		for (j = 0;j < vselects.length;j++) {
			if (vselects[j] == selectBuff[i]) {
				flag = '';
				break;
			}
		}
		selectBuff[i].style.visibility = flag;

	}
	
	objOverlay.style.display = 'block';
}

/* * * * * * * * * * * * * * * * */
function hideLightBox() {
	var objOverlay = document.getElementById('overlay');
	if (objOverlay.blocked) return;
	objOverlay.style.display = 'none';
	var srcEl = document.getElementById(currentLBEl);
	if (srcEl) {
		srcEl.style.display = 'none';
		if (srcEl.onclose) {
			showLightBox(srcEl.onclose);
			srcEl.onclose = null;
			return;
		}
	}
	for (var i = 0;i < selectBuff.length;i++) {
		selectBuff[i].style.visibility = 'visible';
	}
	currentLBEl = null;
}

/* * * * * * * * * * * * * * * * */
function imgReady(lb) {
	//var imaga = imgs[(imgs.length-1)];
	var imaga = this;
	if (imaga) {
		var el = document.getElementById(lb);
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		var width = (imaga.width + 20);
		var height = (imaga.height + 20);
		el.style.width = (width + 'px');
		el.style.height = (height + 'px');
		el.style.background = 'white url(\''+imaga.src+'\') no-repeat center center';
		var ttop = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - height) / 2));
		if (ttop < 0) ttop = 5;
		el.style.top = ttop + 'px';
		el.style.left = (((arrayPageSize[0] - 20 - width) / 2) + 'px');
	}

}

/* * * * * * * * * * * * * * * * */
function showBoxImage(elID,img) {
	var srcEl = document.getElementById(elID);
	srcEl.style.background = 'white url(\'images/icon_wait.gif\') no-repeat center center';
	showLightBox(elID);
	var imaga = new Image();
	imaga.onload = imgReady;
	imaga.src = img;
	imgs.push(imaga);
}
/* * * * * * * * * * * * * * * * */
var lbiInited = false;
function lightBoxImage(srcImg,onclose) {
	var srcEl;
	if (!lbiInited)
	{
		var a,img;
		srcEl = document.createElement('div');
		srcEl.id = 'lbImage';
		srcEl.style.zIndex = 120;srcEl.style.padding = '9px 0px 15px';srcEl.style.width = '200px';srcEl.style.height = '200px';srcEl.style.display = 'none';srcEl.style.position = 'absolute';
		addEvent(srcEl,'click',hideLightBox);

		a = document.createElement('a');
		a.href = 'javascript:;';
		addEvent(a,'click',hideLightBox);
		a.className = 'close';a.style.position = 'absolute';a.style.top = '0px';a.style.right = '0px';

		img = document.createElement('img');img.src = 'images/ico-close.gif';img.alt = 'X';
		a.appendChild(img);
		srcEl.appendChild(a);
		document.body.appendChild(srcEl);
		lbiInited = true;
	} else {
		srcEl = document.getElementById('lbImage');
	}

	srcEl.onclose = onclose ? onclose : null;
	srcEl.style.background = 'white url(\'images/icon_wait.gif\') no-repeat center center';
	showLightBox('lbImage');
	var imaga = new Image();
	imaga.onload = imgReady.bind(imaga,'lbImage');
	imaga.src = srcImg;
	imgs.push(imaga);


}

/* * * * * * * * * * * * * * * * */
function imgBranchReady() {
	var imaga = imgs[(imgs.length-1)];
	var el = document.getElementById('branchmap');
	el.src = imaga.src;

}
/* * * * * * * * * * * * * * * * */
function showBranchImage(elID,img) {
	var el = document.getElementById('branchmap');
	el.style.background = 'white url(\'images/icon_wait.gif\') no-repeat center center';
	showLightBox(elID);
	var imaga = new Image();
	imaga.onload = imgBranchReady;
	imaga.src = img;
	imgs.push(imaga);
}
/* * * * * * * * * * * * * * * * */



/* * * * * * * * * * * * * * * * */

/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
var lang_labels = {adelete:"Вы уверены, что хотите удалить?",comments:"Отзывы",error_mail:"Некорректный email",income:"Входящие",mandatoryfield:"Заполните поле",message:"Сообщение",outgoing:"Исходящие",tanswer:"Ответить",tfrom:"От кого",title:"Заголовок",tto:"Кому",welcome:"Добро пожаловать",date:"Дата"};

