// jQuery LavaLamp 1.3.3 - http://nixboxdesigns.com/projects/jquery-lavalamp/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6(k){k.Y.Z=6(o){o=k.10({I:\'11\',x:12,y:6(){z A},8:\'n\',J:A,B:0,K:A,p:0,q:0,C:0,D:0,L:13},o||{});7 j;4(o.p||o.q){j=k(\'<5 l="M r"></5>\').E({t:o.q,u:o.p,v:o.C,w:o.D,14:\'15\'});k(3).16(j)}z 3.17(6(){7 c=9.F+9.N+9.O;7 d=18 19;7 f;7 g;7 h;7 i=k(\'5[l!=1a]\',3);4(o.8==\'n\')d=k(\'5 a[P$="\'+c+\'"]\',3).Q(\'5\');4(d.R==0&&o.8==\'n\')d=k(\'5 a[P$="\'+9.F.1b(9.F.1c(\'/\')+1)+9.N+9.O+\'"]\',3).Q(\'5\');4(d.R==0||o.8!=\'n\'){4(o.8==\'n\')o.8=0;d=k(i[o.8])}h=k(\'5.r\',3)[0]||k(d).S(\'r\')[0];i.1d(6(){4(k(3).1e(\'M\')){h=k(3)[0]}s(3)});g=k(\'<5 l="1f"><m l="1g"></m><m l="1h"></m><m l="1i"></m></5>\').1j(3);k(3).1k(6(){4(o.J){4(o.L&&j){s(j[0])}G 4(o.B){4(f)1l(f);f=1m(6(){s(T)},o.B+o.x)}G{s(T)}}});i.y(6(e){4(o.K){k(h).1n(\'r\');k(3).S(\'r\');h=3}z o.y.1o(3,[e,3])});4(o.p||o.q)g.E({t:o.q,u:o.p,v:o.C,w:o.D});G g.E({t:h.U,u:h.V,v:h.W,w:h.X});6 s(a){4(!a)a=h;7 b=0,H=0;4(!k.1p.1q){b=(g.1r()-g.1s())/2;H=(g.1t()-g.1u())/2}g.1v().1w({t:a.U-b,u:a.V-H,v:a.W,w:a.X},o.x,o.I)}})}})(1x);',62,96,'|||this|if|li|function|var|startItem|location||||||||||||class|div|no||homeTop|homeLeft|selectedLava|move|left|top|width|height|speed|click|return|true|returnDelay|homeWidth|homeHeight|css|pathname|else|by|fx|autoReturn|setOnClick|returnHome|homeLava|search|hash|href|parent|length|addClass|null|offsetLeft|offsetTop|offsetWidth|offsetHeight|fn|lavaLamp|extend|swing|500|false|position|absolute|prepend|each|new|Object|noLava|substring|lastIndexOf|mouseenter|hasClass|backLava|leftLava|bottomLava|cornerLava|appendTo|mouseleave|clearTimeout|setTimeout|removeClass|apply|browser|msie|outerWidth|innerWidth|outerHeight|innerHeight|stop|animate|jQuery'.split('|'),0,{}))

if (typeof window.console === 'undefined') {
	window.console = {
		log: function () {
			void(0);
		}
	};
}

jQuery(function($) {
	var currContentHeight = 0;
	var maxContentHeight = 0;
	var currTitleHeight = 0;
	var maxTitleHeight = 0;
	var rowLeveler = $('.rowLeveler');
	rowLeveler.each(function() {
		var titleLeveler = $(this).find('.titleLeveler');
		titleLeveler.each(function() {
			currTitleHeight = $(this).height();
			//console.log(this, 'title height:', currTitleHeight, 'px');
			if (currTitleHeight > maxTitleHeight) {
				maxTitleHeight = currTitleHeight;
			}
		});
		titleLeveler.height(maxTitleHeight);
		//console.log('Setting all above objects\' title height to:', maxTitleHeight, 'px');
		currTitleHeight = 0;
		maxTitleHeight = 0;
		
		var contentLeveler = $(this).find('.contentLeveler');
		contentLeveler.each(function() {
			currContentHeight = $(this).height();
			//console.log(this, 'content height:', currContentHeight, 'px');
			if (currContentHeight > maxContentHeight) {
				maxContentHeight = currContentHeight;
			}
		});
		contentLeveler.height(maxContentHeight);
		//console.log('Setting all above objects\' content height to:', maxContentHeight, 'px');
		currContentHeight = 0;
		maxContentHeight = 0;
	});
	
	/*$('input:text')
		.hint()
	;*/
	
	$('.target_blank')
		.attr('target', '_blank')
	;
	
	$('.submitCheck')
		.attr('value', '1')
	;
	
	$('a.inputButton')
		.click(function() {
			$(this)
				.parents('form')
					.submit()
			;
		})
	;
	
	var freecapCode = $('#freecapCode');
	freecapCode
		.click(function () {
			var src = $(this).attr('src');
			var pos = src.lastIndexOf('?');
			if (pos === -1) {
			    pos = src.length;
			}
			src = src.substring(0, pos);
			$(this)
				.attr('src', src + '?' + Math.round(Math.random() * 9999999999));
		})
	;
	
	$('#slideShow2')
		.cycle({ 
			fx: 'fade',
			timeout: 10000,
			speed: 2000,
			random: true
		})
	;
	
	$('#mainMenu')
		.lavaLamp({
			fx: 'easeOutBack',
			speed: 800,
			setOnClick: false,
			returnDelay: 100
		})
	;
	
	$('#cycle')
		.cycle({ 
			fx: 'custom',
			cssBefore: {
				left: 180,
				top:  135,
				width: 0,
				height: 0,
				opacity: 1,
				zIndex: 1
			},
			animOut: {
				opacity: 0
			},
			animIn: {
				left: 0,
				top: 0,
				width: 361,
				height: 271
			},
			cssAfter: {
				zIndex: 0
			},
			timeout: 6000,
			speed: 2000
		})
	;
	
	$('#content .addTextShower')
		.click(function(e) {
			$(this)
				.parents('p')
					.next('.additionalText')
						.slideToggle()
			;
			e
				.preventDefault()
			;
		})
	;
});
