function pc_init() {
	var extraPadding = 110;
	var current_movie = 1;
	var current_q = false;
	var effect_div = $('effect_div');
	var overlay = $('overlay');
	var oh = $('mainbody').getCoordinates().height;
	var fh = new Array();

	var overlay_effect = new Fx.Morph(overlay, {
		duration: 300,
		transition: Fx.Transitions.Quad.easeIn,
		wait: true,
		fps: 30
	});

	var reveal = new Fx.Morph(effect_div, {
		duration: 750,
		transition: Fx.Transitions.Quad.easeIn,
		wait: true,
		fps: 30
	});

	reveal.addEvent('onStart', function(){		
		if (overlay.getCoordinates().height==0) {
			overlay_effect.start({
				'height': [0,oh],
				'opacity': [0,0.80]
			})
		}
	});

	reveal.addEvent('onComplete', function(){
		if ($('slidingTab'+current_movie)) {
//			$('slidingTab'+current_movie).style.display='block';
			$('slidingTab'+current_movie).style.display='block';
			$('slidingTab'+current_movie).style.left='24px';
			$('content_div_top').style.display='block';
			$('content_div_bot').style.display='block';
		}
	});

	var repeal = new Fx.Morph(effect_div, {
		duration: 750,
		transition: Fx.Transitions.Quad.easeIn,
		wait: true,
		fps: 30
	});

	repeal.addEvent('onStart', function(){
		divs = $$('.sth');
		divs.each(function(div) {
			div.style.display='none';
			$('content_div_top').style.display='none';
			$('content_div_bot').style.display='none';
		});
	});

	repeal.addEvent('onComplete', function(){
		if (current_q==true) {
			reveal.start({
				'height': [0,fh[current_movie]],
				'opacity': [0.4,0.98]
			})
		}
		current_q=false;
	});

	media_nav = $('mediaNav');
	//bases = $ES('a',media_nav);  Mootools 1.11
	bases = media_nav.getElements('a');
	bases.each(function(base,index) {
		if (index+1==bases.length) {
			base.clicker = function() {
				if (effect_div.getCoordinates().height>0) {	var eh = effect_div.getCoordinates().height;
					repeal.start({'height': [eh,0],	'opacity': [0.98,0.40]})					
					overlay_effect.start({'height': [oh,0], 'opacity': [0.80,0]})
					bases.each(function(base,index) {base.style.backgroundPosition='0 0';});
					//$$('object').getProperty('id').each(function(el){alert(el);});	
				}
			}
			base.addEvents({
				'click':  function() {
					this.clicker();
				}
			});
		} else {
			var wtf = index+1;			
			var temph = $('slidingTab'+wtf).getCoordinates().height;
			temph=temph+extraPadding;

			fh[index+1] = temph;
			base.clicker = function() {
				current_movie = index+1;
				
				bases.each(function(base,index) {
					if (index+1==current_movie) {
						var bh = base.getCoordinates().height;
						base.style.backgroundPosition='0 '+bh+'px';	
					} else {
						base.style.backgroundPosition='0 0';
					}
				});

				var ch = $('media_close').getCoordinates().height;
				$('media_close').style.backgroundPosition='0 '+ch+'px';
				media_nav.style.backgroundPosition = '0 -131px';
				
				if (effect_div.getCoordinates().height>0) {
					current_q = true;
					var eh = effect_div.getCoordinates().height;
					repeal.start({
						'height': [eh,0],
						'opacity': [0.98,0.40]
					})				
				} else {
					var currentVidId = 'slidingTab' + current_movie + '_inside';	
					reveal.start({
						'height': [0,fh[current_movie]],
						'opacity': [0.40,0.98]
					})
				
					var removeVid = function(id) {swfobject.removeSWF(currentVidId);};
					//alert(onclickJS + " : " + $('media_close').getProperty('onclick'));
					$('media_close').addEvent('click', removeVid.bindWithEvent(currentVidId));
				}
			}

			base.addEvents({
				'click':  function() {
					this.clicker();
				}
			});
		}
	});

	divs = $$('.sth');

	divs.each(function(div) {
		div.style.display='none';
		div.style.visibility='visible';
	});

	var hashy = location.hash;
	var regex=/#/g;	 
	hashy = hashy.replace(regex,'');

	if (hashy==1 || hashy==2 || hashy==3) {
		current_movie = hashy;
		bases.each(function(base,index) {
			if (index+1==current_movie) {
				var bh = base.getCoordinates().height;
				base.style.backgroundPosition='0 '+bh+'px';	
			} else {
				base.style.backgroundPosition='0 0';
			}
		});

		var ch = $('media_close').getCoordinates().height;
		$('media_close').style.backgroundPosition='0 '+ch+'px';

		reveal.start({
			'height': [0,fh[current_movie]],
			'opacity': [0.40,0.98]
		})
	}
	
	//used to see if a tab at the bottom was selected before
	if (hashy) {
		if (hashy.contains('tabline-')) {
			hashSub = hashy.substring(8);
			divShow = 'div_' + hashSub;
			tabShow = 'tab_' + hashSub;
			tabIndex = tabs.indexOf(tabShow) + 1;
			showDiv(divShow);
			tabRollOver(tabShow,tabIndex);
		}
	}
//	$$('.sth').set
}

window.addEvent('domready', function(){
	pc_init();
	var hashy = location.hash;
	var regex=/#/g;	 
	hashy = hashy.replace(regex,'');
	//used to see if a tab at the bottom was selected before
	if (hashy) {
		if (hashy.contains('tabline-')) {
			hashSub = hashy.substring(8);
			divShow = 'div_' + hashSub;
			tabShow = 'tab_' + hashSub;
			tabIndex = tabs.indexOf(tabShow) + 1;
			showDiv(divShow);
			//alert(showDiv(divShow));
		}
	}
	var openOverlayTabOnload = swfobject.getQueryParamValue("ov");
	openOverlayTabOnload ? openOverlayTabOnload : null;
	
	if (openOverlayTabOnload != null)
	{
		var anchorArr = $('mediaNav').getElements('a').getProperty('id');
		for (var i=0; i < anchorArr.length; i++)
		{
			//alert(anchorArr[i] + " | " + openOverlayTabOnload + " | " + i + " | " + anchorArr.length);
			if (anchorArr[i] == openOverlayTabOnload) {
				//alert(typeof openOverlayTabOnload);
				scj.clickElement(anchorArr[i]);
				break;
			}
			else
			{
				//alert('error: incorrect ov value');
			}
		}
	}
});

/*window.addEvent('load', function() {

	var hashy = location.hash;
	var regex=/#/g;	 
	hashy = hashy.replace(regex,'');
	//used to see if a tab at the bottom was selected before
	if (hashy) {
		if (hashy.contains('tabline-')) {
			hashSub = hashy.substring(8);
			divShow = 'div_' + hashSub;
			tabShow = 'tab_' + hashSub;
			tabIndex = tabs.indexOf(tabShow) + 1;
			showDiv(divShow);
			//alert(showDiv(divShow));
		}
	}
	var openOverlayTabOnload = swfobject.getQueryParamValue("ov");
	openOverlayTabOnload ? openOverlayTabOnload : null;
	
	if (openOverlayTabOnload != null)
	{
		var anchorArr = $('mediaNav').getElements('a').getProperty('id');
		for (var i=0; i < anchorArr.length; i++)
		{
			//alert(anchorArr[i] + " | " + openOverlayTabOnload + " | " + i + " | " + anchorArr.length);
			if (anchorArr[i] == openOverlayTabOnload) {
				//alert(typeof openOverlayTabOnload);
				scj.clickElement(anchorArr[i]);
				break;
			}
			else
			{
				//alert('error: incorrect ov value');
			}
		}
	}
});*/