var tab_masks = {
'koblevo': 1
}
function collapseBox(id, container, dopen, dclose, group){
var box = ge(id);
if (!box) return;
var masks = (group) ? group_tab_masks : tab_masks;
var cookie_key = (group) ? 'group_closed_tabs' : 'closed_tabs';
var c = geByClass("c", box)[0];
if (!c) return;
var newClass = isVisible(c) ? "bShut" : "bOpen";
if (slideToggle(c, 700, function() {
if (!masks[id]) return;
var closed_tabs = parseInt(getCookie('remix' + cookie_key));
if (isVisible(c)) {
closed_tabs = isNaN(closed_tabs) ? 0 : closed_tabs & ~masks[id];
} else {
closed_tabs = isNaN(closed_tabs) ? masks[id] : closed_tabs | masks[id];
}
})) {
container.parentNode.className = newClass;
}
return false;
}
function ge() {
var ea;
for (var i = 0; i < arguments.length; i++) {
var e = arguments[i];
if (typeof e == 'string')
e = document.getElementById(e);
if (arguments.length == 1)
return e;
if (!ea)
ea = new Array();
ea.push(e);
}
return ea;
}
function geByClass(searchClass, node, tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
if (node.getElementsByClassName) {
classElements = node.getElementsByClassName(searchClass);
if (tag != '*') {
for (i = 0; i < classElements.length; i++) {
if (classElements.nodeName == tag)
classElements.splice(i, 1);
}
}
return classElements;
}
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}
function show(elem) {
if (arguments.length > 1) {
for (var i = 0; i < arguments.length; i++) {
show(arguments[i]);
}
return;
}
elem = ge(elem);
if (!elem) return;
var old = data(elem, "olddisplay");
elem.style.display = old || "";
if (getStyle(elem, 'display') == "none" ) {
if (elem.tagName.toLowerCase() == 'tr' && !browser.msie) {
elem.style.display = 'table-row';
} else if (elem.tagName.toLowerCase() == 'table' && !browser.msie) {
elem.style.display = 'table';
} else {
elem.style.display = data(elem, "olddisplay", "block");
}
}
}
function hide(elem){
if (arguments.length > 1) {
for (var i = 0; i < arguments.length; i++) {
hide(arguments[i]);
}
return;
}
elem = ge(elem);
if (!elem) return;
if (getStyle(elem, 'display') != "none")
data(elem, "olddisplay", elem.style.display);
elem.style.display = "none";
}
function isVisible(elem) {
elem = ge(elem);
return getStyle(elem, 'display') != 'none' && getStyle(elem, 'visibility') != 'hidden';
}
function toggle(elem) {
if (isVisible(elem)) {
hide(elem);
} else {
show(elem);
}
}
window.shide = toggle;
var hfTimeout;
function toggleFlash(show, timeout) {
if (/mac/i.test(navigator.userAgent)) return;
clearTimeout(hfTimeout);
if (timeout > 0) {
hfTimeout = setTimeout(function(){toggleFlash(show, 0)}, timeout);
return;
}
var body = document.getElementsByTagName('body')[0];
var f = function() { this.style.visibility = show ? 'visible' : 'hidden'; };
each(body.getElementsByTagName('embed'), f);
each(body.getElementsByTagName('object'), f);
}
function getXY(obj) {
if (!obj || obj == undefined) return;
var left = 0, top = 0;
if (obj.offsetParent) {
do {
left += obj.offsetLeft;
top += obj.offsetTop;
} while (obj = obj.offsetParent);
}
return [left,top];
}
function getSize(elem, withoutBounds) {
var s = [0, 0];
if (elem == document) {
s =  [Math.max(
document.documentElement["clientWidth"],
document.body["scrollWidth"], document.documentElement["scrollWidth"],
document.body["offsetWidth"], document.documentElement["offsetWidth"]
), Math.max(
document.documentElement["clientHeight"],
document.body["scrollHeight"], document.documentElement["scrollHeight"],
document.body["offsetHeight"], document.documentElement["offsetHeight"]
)];
} else if (elem){
function getWH() {
s = [elem.offsetWidth, elem.offsetHeight];
if (!withoutBounds) return;
var padding = 0, border = 0;
each(s, function(i, v) {
var which = i ? ['Top', 'Bottom'] : ['Left', 'Right'];
each(which, function(){
s[i] -= parseFloat(getStyle(elem, "padding" + this)) || 0;
s[i] -= parseFloat(getStyle(elem, "border" + this + "Width")) || 0;
});
});
s = [Math.round(s[0]), Math.round(s[1])];
}
if (!isVisible(elem)) {
var props = {position: "absolute", visibility: "hidden", display:"block"};
var old = {};
each(props, function(i, val){
old[i] = elem.style[i];
elem.style[i] = val;
});
getWH();
each(props, function(i, val){
elem.style[i] = old[i];
});
} else getWH();
}
return s;
}
Function.prototype.bind = function(object) {
var __method = this;
return function() {
return __method.apply(object, arguments);
}
};
function isFunction(obj) {return Object.prototype.toString.call(obj) === "[object Function]"; }
function isArray(obj) { return Object.prototype.toString.call(obj) === "[object Array]"; }
function now() { return +new Date; }
function trim(text) { return (text || "").replace(/^\s+|\s+$/g, ""); }
function stripHTML(text) { return text ? text.replace(/<(?:.|\s)*?>/g, "") : ''; }
function escapeRE(s) { return s ? s.replace(/[.*+?^${}()|[\]\/\\]/g, '\\$0') : ''; }
function each(object, callback) {
var name, i = 0, length = object.length;
if ( length === undefined ) {
for ( name in object )
if ( callback.call( object[ name ], name, object[ name ] ) === false )
break;
} else
for ( var value = object[0];
i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
return object;
};
function indexOf(arr, value, from) {
from = (from == null) ? 0 : from;
var m = arr.length;
for(var i = from; i < m; i++)
if (arr[i] == value)
return i;
return -1;
}
function clone(obj) {
var newObj = {};
for (var i in obj) {
newObj[i] = obj[i];
}
return newObj;
}
function extend() {
var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
if (typeof target === "boolean") {
deep = target;
target = arguments[1] || {};
i = 2;
}
if (typeof target !== "object" && !isFunction(target))
target = {};
if (length == i) {
return target;
}
for (; i < length; i++)
if ((options = arguments[i]) != null)
for (var name in options) {
var src = target[name], copy = options[name];
if (target === copy)
continue;
if (deep && copy && typeof copy === "object" && !copy.nodeType)
target[name] = extend(deep,
src || (copy.length != null ? [] : { })
, copy);
else if (copy !== undefined)
target[name] = copy;
}
return target;
}
function hasClass(obj, name) {
obj=ge(obj);
return obj && (new RegExp('(\\s|^)' + name + '(\\s|$)')).test(obj.className);
}
function addClass(obj, name) {
obj=ge(obj);
if (obj && !hasClass(obj, name)) obj.className = (obj.className ? obj.className + ' ' : '') + name;
}
function removeClass(obj, name) {
obj=ge(obj);
if (obj && hasClass(obj, name)) obj.className = obj.className.replace((new RegExp('(\\s|^)' + name + '(\\s|$)')), ' ');
}
function getStyle(elem, name, force) {
elem = ge(elem);
if (force !== undefined && !force) return elem.style[name];
if (name == "width" || name == "height") {
return getSize(elem, true)[({'width':0, 'height':1})[name]] + 'px';
}
var ret, defaultView = document.defaultView || window;
if (defaultView.getComputedStyle) {
name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
var computedStyle = defaultView.getComputedStyle( elem, null );
if (computedStyle)
ret = computedStyle.getPropertyValue(name);
} else if (elem.currentStyle) {
if (name == 'opacity' && browser.msie) {
var filter = elem.currentStyle['filter'];
return filter && filter.indexOf("opacity=") >= 0 ?
(parseFloat(filter.match(/opacity=([^)]*)/)[1] ) / 100) + '' : '1';
}
var camelCase = name.replace(/\-(\w)/g, function(all, letter){
return letter.toUpperCase();
});
ret = elem.currentStyle[name] || elem.currentStyle[camelCase];
if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
var left = style.left, rsLeft = elem.runtimeStyle.left;
elem.runtimeStyle.left = elem.currentStyle.left;
style.left = ret || 0;
ret = style.pixelLeft + "px";
style.left = left;
elem.runtimeStyle.left = rsLeft;
}
}
return ret;
}
function setStyle(elem, name, value){
elem = ge(elem);
if (typeof name == 'object') return each(name, function(k,v){setStyle(elem,k,v);});
if (name == 'opacity'){
if (browser.msie) {elem.style.filter = "alpha(opacity=" + value*100 + ")"; elem.style.zoom = 1; };
elem.style.opacity = value;
} else elem.style[name] = typeof(value) == 'number' && !(/z-?index|font-?weight|opacity|zoom|line-?height/i).test(name) ? value + 'px': value;
}
var expand = "VK" + now(), vk_uuid = 0, vk_cache = {};
function data(elem, name, data) {
var id = elem[ expand ], undefined;
if ( !id )
id = elem[ expand ] = ++vk_uuid;
if (name && !vk_cache[id])
vk_cache[id] = {};
if (data !== undefined)
vk_cache[id][name] = data;
return name ?
vk_cache[id][name] :
id;
}
function animate(el, params, speed, callback) {
el = ge(el);
var options = extend({}, typeof speed == 'object' ? speed : {duration: speed, onComplete: callback || function(){}});
var tween = data(el, 'tween');
if (tween) {
tween.setOptions(options);
} else {
tween = data(el, 'tween', new Fx.Base(el, options));
}
return tween.custom(params);
}
function fadeTo(el, speed, to, callback) {return animate(el, {opacity: to}, speed, callback);}
var Fx = fx = {};
Fx.Transitions = {
linear: function(t, b, c, d) { return c*t/d + b; },
sineInOut: function(t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; },
easeOutBack: function(t, b, c, d) { var s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }
};
Fx.Attrs = [
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
[ "opacity" ]
];
function genFx(type, num){
var obj = {};
each( Fx.Attrs.concat.apply([], Fx.Attrs.slice(0,num)), function(){
obj[this] = type;
});
return obj;
};
each({slideDown: genFx('show', 1),
slideUp: genFx('hide', 1),
slideToggle: genFx('toggle', 1),
fadeIn: {opacity: 'show'},
fadeOut: {opacity: 'hide'},
fadeToggle: {opacity: 'toggle'}}, function(f, val){
window[f] = function(el, speed, callback){return animate(el, val, speed, callback);}
});
Fx.Base = function(el, options){
this.element = ge(el);
this.setOptions(options);
this.now = {};
};
Fx.Base.prototype = {
setOptions: function(options){
if (this.isTweening()) return;
this.options = extend({
onComplete: function(){},
transition: Fx.Transitions.sineInOut,
duration: 500
}, options || {});
},
step: function(){
var time = new Date().getTime();
if (time < this.time + this.options.duration){
this.cTime = time - this.time;
this.setNow();
} else {
setTimeout(this.options.onComplete.bind(this, this.element), 10);
this.clearTimer();
this.now = this.to;
if (this.options.hide) hide(this.element);
if (this.options.hide || this.options.show) {
this.now = this.options.orig;
}
this.increase();
return false;
}
this.increase();
return true;
},
setNow: function(){
for (p in this.from) {
if (isArray(this.to[p]))
this.now[p] = [Math.min(parseInt(this.compute(this.from[p][0], this.to[p][0])), 255), Math.min(parseInt(this.compute(this.from[p][1], this.to[p][1])), 255), Math.min(parseInt(this.compute(this.from[p][2], this.to[p][2])), 255)];
else
this.now[p] = this.compute(this.from[p], this.to[p]);
}
},
compute: function(from, to){
var change = to - from;
return this.options.transition(this.cTime, from, change, this.options.duration);
},
clearTimer: function(){
clearInterval(this.timer);
this.timer = null;
return this;
},
_start: function(from, to){
if (this.timer) return;
this.from = from;
this.to = to;
this.time = new Date().getTime();
if (this.step()) this.timer = setInterval(this.step.bind(this), 13);
return this;
},
increase: function(){
for (var p in this.now) {
if (isArray(this.now[p])) setStyle(this.element, p, 'rgb(' + this.now[p].join(',') + ')');
else this.element[p] != undefined ? (this.element[p] = this.now[p]) : setStyle(this.element, p, this.now[p]);
}
},
isTweening: function() {
return this.timer ? true : false;
},
custom: function(prop){
if (this.isTweening()) return false;
var from = {}, to = {}, visible = isVisible(this.element), from_val, self = this;
self.options.show = self.options.hide = false;
self.options.orig = {};
for (p in prop) {
if (prop[p] == 'show' && visible || prop[p] == 'hide' && !visible)
return this.options.onComplete.call(this, this.element);
}
each(prop, function(name, val){
if (/backgroundColor|borderBottomColor|borderLeftColor|borderRightColor|borderTopColor|color|borderColor|outlineColor/.test(name)) {
var p = (name == 'borderColor') ? 'borderTopColor' : name;
from_val = getColor(self.element, p);
val = getRGB(val);
} else {
from_val = parseFloat(self.element[name] != undefined ? self.element[name] : getStyle(self.element, name)) || 0;
val = val == 'toggle' ? visible ? 'hide' : 'show' : val;
if (val == 'show') {
self.options.show = true;
val = from_val;
from_val = (name == "width" || name == "height" ? 1 : 0);
show(self.element);
} else if (val == 'hide') {
self.options.hide = true;
val = 0;
} else {
var parts = val.toString().match(/^([\d+-.]+)(.*)$/);
val = parts ? parseFloat(parts[1]) : val;
}
if (self.options.hide || self.options.show)
self.options.orig[name] = getStyle(self.element, name, false);
if ((name == "height" || name == "width") && self.element.style) {
self.element.style.overflow = 'hidden';
self.element.style.display = 'block';
}
if (name == "opacity" && val > 0 && !visible) {
setStyle(self.element, 'opacity', 0);
from_val = 0;
show(self.element);
}
}
if (from_val != val || (isArray(from_val) && from_val.join(',') == val.join(','))) {
from[name] = from_val;
to[name] = val;
}
});
return this._start(from, to);
}
};

