window.addEvent('domready', function(){
	
	var scroll = new Fx.Scroll('textBlock', {
		wait: false,
		duration: 750,
		transitions: Fx.Transitions.Sine.easeInOut
	});


/*  ====== ONLOAD SCRIPTS ====== */
	
/*	var onloadtextdiv = $('textBlock').effects({duration: 2000, transition: Fx.Transitions.Quart.easeOut});
	var onloadtextpara = $('openingPara').effects({duration: 500, wait: false});
	
	var onload_pageContainer = $('pageContainer').effects({duraction: 1500, wait: false});
	var onload_title1 = $('fromDesks').effects({duration: 1000, wait: false});
	var onload_title2 = $('toDead').effects({duration: 1000, wait: false});
*/	

/*	onload_pageContainer.start({
		'opacity': [0,1]
	}).chain(function() {
		onload_title1.start({'opacity': [0,1]});
		(function() {onload_title2.start({'opacity': [0,1]})}).delay(1000);
	});
	
	onloadtextdiv.start({
		
	}).chain(function(){
		onloadtextpara.start({'opacity': [0,1]});
		scroll.toElement('frame1');
	});
*/
	scroll.toElement('frame1');
/* ====== TIPS JS ====== */
	/*var Tips2 = new Tips($$('.f2tips'), {
		initialize:function(){
			this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
		},
		onShow: function(toolTip) {
			this.fx.start(1);
		},
		onHide: function(toolTip) {
			this.fx.start(0);
		}
	});*/


/* ====== GALLERIES ====== */
	var currentGallery = $('frame1Gallery');

	function hideLastGalleries() {
		currentGallery.effect('opacity', {duration: 250, transition:Fx.Transitions.linear}).start(0);
	}
	
	$('a1').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('frame1');
		hideLastGalleries();
	});
	
	$('a2').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('frame2');
		hideLastGalleries();
		currentGallery = $('frame2Gallery');
		
		currentGallery.effect('opacity', {duration: 500, transition:Fx.Transitions.linear}).start(0,1);
		currentGallery.style.display = "block";
	});
	
	$('a3').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('frame3');
		hideLastGalleries();
		currentGallery = $('frame3Gallery');
		currentGallery.effect('opacity', {duration: 500, transition:Fx.Transitions.linear}).start(0,1);
		currentGallery.style.display = "block";
	});
	
	$('a4').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('frame4');
		hideLastGalleries();
		currentGallery = $('frame4Gallery');
		currentGallery.effect('opacity', {duration: 500, transition:Fx.Transitions.linear}).start(0,1);
		currentGallery.style.display = "block";
	});
	
	$('a5').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('frame5');
		hideLastGalleries();
		currentGallery = $('frame5Gallery');
		currentGallery.effect('opacity', {duration: 500, transition:Fx.Transitions.linear}).start(0,1);
		currentGallery.style.display = "block";
	});
	
	$('a6').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('frame6');
		hideLastGalleries();
		currentGallery = $('frame6Gallery');
		currentGallery.effect('opacity', {duration: 500, transition:Fx.Transitions.linear}).start(0,1);
		currentGallery.style.display = "block";
	});
	
/* ====== FRAME 2 GALLERY ====== */
	var margintopstart = 0;
	var margintopend = 8;
	

	$('f21').addEvent('mouseenter', function(event) {
		$('f2img').setProperty('src', 'images/frameGalleries/frame2/bold.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopend);
	});

	
	$('f21').addEvent('mouseleave', function(event) {
		//$('f2img').setProperty('src', 'images/frameGalleries/frame2/2.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopstart);
	});
	
	$('f22').addEvent('mouseenter', function(event) {
		$('f2img').setProperty('src', 'images/frameGalleries/frame2/3.gif');
		$('f2img').setProperty('onclick', "window.location.href='polycomvideo.html'");
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopend);
	});
	
	$('f22').addEvent('mouseleave', function(event) {
		//$('f2img').setProperty('src', 'images/frameGalleries/frame2/2.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopstart);
	});
	
	$('f23').addEvent('mouseenter', function(event) {
		$('f2img').setProperty('src', 'images/frameGalleries/frame2/4.gif');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopend);
	});
	
	$('f23').addEvent('mouseleave', function(event) {
		//$('f2img').setProperty('src', 'images/frameGalleries/frame2/2.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopstart);
	});
	
	$('f24').addEvent('mouseenter', function(event) {
		$('f2img').setProperty('src', 'images/frameGalleries/frame2/5.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopend);
	});
	
	$('f24').addEvent('mouseleave', function(event) {
		//$('f2img').setProperty('src', 'images/frameGalleries/frame2/2.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopstart);
	});
	
	$('f25').addEvent('mouseenter', function(event) {
		$('f2img').setProperty('src', 'images/frameGalleries/frame2/6.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopend);
	});
	
	$('f25').addEvent('mouseleave', function(event) {
		//$('f2img').setProperty('src', 'images/frameGalleries/frame2/2.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopstart);
	});
	
	$('f26').addEvent('mouseenter', function(event) {
		$('f2img').setProperty('src', 'images/frameGalleries/frame2/7.gif');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopend);
	});
	
	$('f26').addEvent('mouseleave', function(event) {
		//$('f2img').setProperty('src', 'images/frameGalleries/frame2/2.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopstart);
	});
	
/* ====== FRAME 2 GALLERY ====== */
	$('f31').addEvent('mouseenter', function(event) {
		$('f3img').setProperty('src', 'images/frameGalleries/frame3/jurekwide.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopend);
	});
	
	$('f31').addEvent('mouseleave', function(event) {
		//$('f3img').setProperty('src', 'images/frameGalleries/frame3/11.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopstart);
	});
	
	$('f32').addEvent('mouseenter', function(event) {
		$('f3img').setProperty('src', 'images/frameGalleries/frame3/privatewide.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopend);
	});
	
	$('f32').addEvent('mouseleave', function(event) {
		//$('f3img').setProperty('src', 'images/frameGalleries/frame3/11.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopstart);
	});
	
	$('f33').addEvent('mouseenter', function(event) {
		$('f3img').setProperty('src', 'images/frameGalleries/frame3/marranowide.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopend);
	});
	
	$('f33').addEvent('mouseleave', function(event) {
		//$('f3img').setProperty('src', 'images/frameGalleries/frame3/11.jpg');
		this.effect('padding-top', {duration: 250, transition: Fx.Transitions.linear}).start(margintopstart);
	});
	
	
});