var KaSite = function() {};;
KaSite.__fadeInterrupted__ = false;;
KaSite.setMini = function (idx) {
 return function() {
var minis = CommonLisp.removeIf (function (node) {
 return ("DIV" !== node.nodeName);
},WebthitethJs.$ ("minis").childNodes);

var __WEBTHITETH_SAFE__G524 = function (it) {
 return it.className = "unselected-thumb";
};
var __WEBTHITETH_SAFE__G525 = minis;
for (var __WEBTHITETH_SAFE__G526 = 0 ; __WEBTHITETH_SAFE__G526 < __WEBTHITETH_SAFE__G525.length  ; __WEBTHITETH_SAFE__G526++ ) {
 __WEBTHITETH_SAFE__G524(__WEBTHITETH_SAFE__G525[__WEBTHITETH_SAFE__G526]);
}
;

 return CommonLisp.nth(idx, minis).className = false;}();
};
;
KaSite.startFader = function () {
var idx = false;
if (arguments[0] !== undefined)
{idx = arguments[0];
} else {
idx = 1;
}

 return function() {
var realIdx = (idx % (KaSite.__menuItems__ || []).length);
var menuItem = function(lst, n){return lst && lst.length > n && lst[n];}(KaSite.__menuItems__, realIdx);
 return function() {if (KaSite.__fadeInterrupted__ !== false) {
 return function() {
 return function() {
var newIdx = KaSite.__fadeInterrupted__;
KaSite.__fadeInterrupted__ = false;

 return window.setTimeout (function () {
 return KaSite.startFader ((newIdx + 1));
},6000);}();}();;
}  else if (true !== false) {
 return function() {
KaSite.setMini (realIdx);

 return KaSite.fadeImg (("/images/main/" || "")  + (function(lst){return lst && lst.length > 0 && lst[0];}(menuItem) || "") ,function(lst){return lst && lst.length > 1 && lst[1];}(menuItem),function(lst){return lst && lst.length > 2 && lst[2];}(menuItem),function () {
 return window.setTimeout (function () {
 return KaSite.startFader ((realIdx + 1));
},3000);
});}();;
}  else { return false; }}();}();
};
;
KaSite.setOpacity = function (e,percent) {
e.style.opacity = "" + (percent / 100);

 return e.style.filter = ("alpha(opacity=" || "")  + ("" + percent || "")  + (")" || "") ;
};
;
KaSite.setImg = function (newUrl,newItem,newHref,callback) {
 return function() {
var img1 = WebthitethJs.$ ("img1");
var img2 = WebthitethJs.$ ("img2");
img1.src = newUrl;

img2.src = newUrl;

KaSite.setOpacity (img1,100);

if (newHref !== false) {
WebthitethJs.$ ("currentitemlink").href = newHref;
;
} ;

if (newHref !== false) {
WebthitethJs.$ ("img-link").href = newHref;
;
} ;

if (newItem !== false) {
WebthitethJs.replaceChildren (WebthitethJs.$ ("currentitem"),document.createTextNode (newItem));
;
} ;

 return function() {if (callback !== false) {
 return callback ();;
}  else { return false; }}();}();
};
;
KaSite.fadeImg = function (newUrl,newItem,newHref,callback) {
 return function() {
var img1 = WebthitethJs.$ ("img1");
var img2 = WebthitethJs.$ ("img2");
 return function() {
var func = function (percent) {
 return function () {
 return function() {if ((! (KaSite.__fadeInterrupted__ !== false)) !== false) {
 return function() {if ((100 <= percent) !== false) {
 return KaSite.setImg (newUrl,newItem,newHref,callback);;
}  else if (true !== false) {
 return function() {
KaSite.setOpacity (img1,(100 - percent));

KaSite.setOpacity (img2,percent);

 return window.setTimeout (func ((3 + percent)),20);}();;
}  else { return false; }}();;
}  else { return false; }}();
};
};
KaSite.setOpacity (img2,0);

img2.src = newUrl;

img2.style.display = "";

 return window.setTimeout (func (0),100);}();}();
};
;
KaSite.interruptFade = function (menuItem,idx) {
KaSite.__fadeInterrupted__ = idx;

KaSite.setMini (idx);

 return function() {
var img = WebthitethSelectors.domSelect (WebthitethSelectors.innerAttr ("img-name",menuItem));
 return KaSite.setImg (("/images/main/" || "")  + (menuItem || "") ,function() {if (WebthitethJs.definedP (img.getAttribute) !== false) {
 return img.getAttribute ("link-text");;
}  else { return false; }}(),function() {if (WebthitethJs.definedP (img.getAttribute) !== false) {
 return img.getAttribute ("dest");;
}  else { return false; }}(),false);}();
};
;
KaSite.__allParties__ = false;;
KaSite.showParty = function (party) {

var __WEBTHITETH_SAFE__G527 = function (it) {
 return function() {
WebthitethJs.$ (("link-" || "")  + (it || "") ).style.color = "";

WebthitethJs.$ (("link-" || "")  + (it || "") ).style.textDecoration = "underline";

 return WebthitethJs.hide (WebthitethJs.$ (("party-desc-" || "")  + (it || "") ));}();
};
var __WEBTHITETH_SAFE__G528 = KaSite.__allParties__;
for (var __WEBTHITETH_SAFE__G529 = 0 ; __WEBTHITETH_SAFE__G529 < __WEBTHITETH_SAFE__G528.length  ; __WEBTHITETH_SAFE__G529++ ) {
 __WEBTHITETH_SAFE__G527(__WEBTHITETH_SAFE__G528[__WEBTHITETH_SAFE__G529]);
}
;

WebthitethJs.$ (("link-" || "")  + (party || "") ).style.color = "white";

WebthitethJs.$ (("link-" || "")  + (party || "") ).style.textDecoration = "none";

 return WebthitethJs.show (WebthitethJs.$ (("party-desc-" || "")  + (party || "") ));
};
;
