function initMainPage() {
window.addEvent('domready', function() {

ipan3 = $('pan3');
ipan2 = $('pan2');
ipan1 = $('pan1');


$$('#pan3 a').addEvent('mouseenter', function(e) {
	var e = new Event(e);
	if (this.act) return false;
	this.act = 1;
	var zz = new Fx.Style(this, 'margin-top', {
		transition: Fx.Transitions.Back.easeInOut,
		duration: 200,
		onComplete: function() {
			this.element.act = 0;
		}

	});

	zz.start(2, 0);



});


ipancont = $('all_menu')
speed_modifier = 20;

function checkMove() {
	tmp = lastpos1 + speed1;

	ipan1.style.marginLeft = tmp + 'px';
	speed1 = (topos1 - tmp) / speed_modifier;
	lastpos1 = tmp;

	tmp2 = lastpos2 + speed2;

	ipan2.style.marginLeft = ( tmp2) + 'px';
	speed2 = (topos2 - tmp2) / speed_modifier;
	lastpos2 = tmp2;

	tmp3 = lastpos3 + speed3;
	ipan3.style.left = -tmp3 + 'px';
	speed3 = (topos3 - tmp3) / speed_modifier;
	lastpos3 = tmp3;

/*
	tmp = window.getScrollWidth();

	$('headertext').innerHTML = parseInt($('headertext').innerHTML) + 1;
	if ($('headertext').innerHTML == 'NaN') $('headertext').innerHTML = 1;

	if (tmp != window.curScrollWidth) {
		ipancont.fireEvent('mousemove', [{page: {x : window.curScrollWidth / 2}}, 1]);
	}
	window.curScrollWidth = tmp;
*/


}

checkMove.periodical(20);

setTimeout('ipan1.style.display = "block"', 30);


ipancont.addEvent('mousemove', function(e, z) {
	if (!z) var e = new Event(e);

	node = this;

	var wii = window.curScrollWidth;


	origperc = e.page.x / wii;

	modifi = (window.curWidth + 300) / 2100

	perc = (origperc - 0.5) * modifi + 0.5
	perc2 = origperc


	topos1 = -parseInt(perc2 * (1720 - wii));
	topos2 = -topos1  -parseInt(perc * (1800 - wii));
	topos3 = (origperc - 0.5) * 100;

	if (z) {
		lastpos1 = topos1;
		lastpos2 = topos2;
		lastpos3 = topos3;
	}

	speed1 = (topos1 - lastpos1) / speed_modifier;
	speed2 = (topos2 - lastpos2) / speed_modifier;
	speed3 = (topos3 - lastpos3) / speed_modifier


});

	window.addEvent('resize', function(e) {
		window.curWidth = window.getWidth();
		window.curScrollWidth = window.getScrollWidth();

		ipancont.fireEvent('mousemove', [{page: {x : window.curScrollWidth / 2}}, 1]);
	});
	window.fireEvent('resize');

if ($('pancont')) ipan1 = $('pancont').ipan1 = $('pan1');

perc = 0.5;

var lastpos1 = -parseInt(perc * (1720 - window.curScrollWidth));
var lastpos2 = -lastpos1  -parseInt(perc * (1800 - window.curScrollWidth));
var lastpos3 = 0;
var topos1 = lastpos1;
var topos2 = lastpos2;
var topos3 = lastpos3;
var speed1 = 0;
var speed2 = 0;
var speed3 = 0;


function drawelement(node, x, y, width, height) {
	var tmp = new Element('div', {
		styles: {
			'position': 'absolute',
			'left': x + 'px',
			'top': y + 'px',
			'width': width,
			'height': height,
			'background-position': '-' + x + 'px -' + y + 'px'
		},
		'class': 'part'
	});
	node.appendChild(tmp);
}

}); }


function on_check( obj ) {
   var mozilla = document.getElementById && !document.all;

   if( obj.checked ) {

      var parent_obj = mozilla ? obj.parentNode.parentNode.parentNode : obj.parentElement.parentElement.parentElement;
      if( parent_obj.className != 'forma' ) {
         parent_obj.getElementsByTagName( 'input' )[0].checked = true;
         parent_obj.getElementsByTagName( 'input' )[0].onclick();

      } // End if

   } else {
      var parent_obj = mozilla ? obj.parentNode : obj.parentElement;
      if( parent_obj.getElementsByTagName( 'ul' ).length ) {
         var li_array = parent_obj.getElementsByTagName( 'ul' )[0].getElementsByTagName( 'li' );
         for( var i = 0; i < li_array.length ; i++ ) {
            li_array[i].getElementsByTagName( 'input' )[0].checked=false;
         } // End for

      } // End if

   } // End if

} // End function on_check
