window.addEvent("domready",function(){

var Thiswidth=screen.width;
var Thisheight=screen.height;

window.moveTo(0,0);
window.resizeTo(Thiswidth,Thisheight);

initImage('centerImage');
initImage('centerImageTag');

if (Thiswidth == 800)
{

document.getElementById("centerImage").style.marginLeft = "200px";
document.getElementById("centerImageTag").style.marginLeft = "200px";

}

if (Thiswidth == 1024)
{

document.getElementById("centerImage").style.marginLeft = "330px";
document.getElementById("centerImageTag").style.marginLeft = "330px";

}
if (Thiswidth == 1152)
{

document.getElementById("centerImage").style.marginLeft = "395px";
document.getElementById("centerImageTag").style.marginLeft = "395px";

}
if (Thiswidth == 1280)
{

document.getElementById("centerImage").style.marginLeft = "460px";
document.getElementById("centerImageTag").style.marginLeft = "460px";

}
if (Thiswidth == 1344)
{

document.getElementById("centerImage").style.marginLeft = "500px";
document.getElementById("centerImageTag").style.marginLeft = "500px";

}
if (Thiswidth == 1360)
{

document.getElementById("centerImage").style.marginLeft = "480px";
document.getElementById("centerImageTag").style.marginLeft = "480px";

}
if (Thiswidth == 1440)
{

document.getElementById("centerImage").style.marginLeft = "500px";
document.getElementById("centerImageTag").style.marginLeft = "500px";

}
if (Thiswidth == 1600)
{

document.getElementById("centerImage").style.marginLeft = "610px";
document.getElementById("centerImageTag").style.marginLeft = "610px";

}
if (Thiswidth == 1680)
{

document.getElementById("centerImage").style.marginLeft = "660px";
document.getElementById("centerImageTag").style.marginLeft = "660px";

}
if (Thiswidth == 1920)
{

document.getElementById("centerImage").style.marginLeft = "930px";
document.getElementById("centerImageTag").style.marginLeft = "930px";

}		

var customTips = $$('.tooltip');

var toolTips = new Tips(customTips, {
	//this will set how long before 
	//the tooltip will wait to show up
	//when you mouseover the element
	//in milliseconds
	showDelay: 100,    //default is 100
	
	//this is how long the tooltip
	//will delay bofore hiding
	//when you leave
	hideDelay: 100,   //default is 100
	
	//this will add a wrapper div 
	//with the following class to your tooltips
	//this lets you have different styles of tooltips
	//on the same page
	className: 'anything', //default is null
	
	//this sets the x and y offets
	offsets: {
		'x': 50,       //default is 16
		'y': 16        //default is 16
	},
	
	//this determines whether the tooltip
	//remains staitionary or follows your cursor
	//true makes it stationary
 	fixed: false,      //default is false
	
	//if you call the functions outside of the options
	//then it may "flash" a bit on transitions
	//much smoother if you leave them in here
	onShow: function(toolTipElement){
	    //passes the tooltip element
		//you can fade in to full opacity
		//or leave them a little transparent
    	toolTipElement.fade(.8);
		$('show').highlight('#FFF504');
	},
	onHide: function(toolTipElement){
    	toolTipElement.fade(0);
		$('hide').highlight('#FFF504');
	}
});

var status = {
		'true': 'open',
		'false': 'close'
	};

		var mySlide = new Fx.Slide('OCA_page');
		mySlide.hide();

	$('slidein').addEvent('click', function(e){
		//e = new Event(e);
		new Fx.Tween('begin',{
            onComplete: function() {
                mySlide.slideIn();
                scroll.toElement('content1');
                }
        }).start('opacity',0);       	
  
		//mySlide.slideIn();

		e.stop();
	

	});
	
		$('slidein1').addEvent('click', function(e){
		//e = new Event(e);
		new Fx.Tween('begin',{
            onComplete: function() {
                mySlide.slideIn();
                scroll.toElement('content1');
                }
        }).start('opacity',0);       	
  
		//mySlide.slideIn();

		e.stop();
	

	});


	//.fade will also accept 'out' and 'in', equaling 0 and 1 respectively
	//$('slideout').addEvent('click', function(e){
	//	e.stop();
	//	mySlide.slideOut();
	//	scroll.toElement('content1');
//
//	});
	
	var scroll = new Fx.Scroll('OCA_Content_Frame', {
		//wait: false,
		link: 'cancel',
		duration: 2500,
		offset: {'x': 0, 'y': 0},
		transition: Fx.Transitions.Sine.easeInOut
	});
	
	
	$('link2').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('content4');
	});
	 
	$('link3').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('content3');
	
	});
	
	
	 $('link4').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('content2');
	});
	
	 $('link5').addEvent('click', function(event) {
		event = new Event(event).stop();
		scroll.toElement('content5');
	});

})

// SiFR
//<![CDATA[
//if(typeof sIFR == "function"){
//	sIFR.replaceElement(named({sSelector:"h2", sFlashSrc:"../sifr/sifr.swf", sColor:"#000000", sLinkColor:"#FFFFFF", sBgColor:"#000000", sHoverColor:"#CCCCCC", sWmode:"transparent",sFlashVars:"textalign=right"}));
//};
//]]>
 

/*
var myFx = new Fx.Style('introduction_photo', 'opacity', {duration: 1500, wait: true});
var morph = new Fx.Morph('introduction', {link: 'chain'}, {duration: 2000, transition: Fx.Transitions.Sine.easeOut});

$('fadein1').addEvent('click', function(e){
	e = new Event(e);
	var myDiv = $('introduction_photo');
	myFx.start(1,0.2).chain(function() {
		morph.start({'opacity': 1}).chain(function() {
			myFx.start(0.2,1);
			});
		});
		e.stop();
	});
})
*/
/*
$('fadein2').addEvent('click', function(e){
	e = new Event(e);
	var myDiv = $('introductionPIC');
     var morph = new Fx.Morph('gallery_right', {link: 'chain'}, {duration: 2000, transition: Fx.Transitions.Sine.easeOut});
     morph.start({'opacity': 0}).chain(function(){
       	mySlide.slideIn();
       		scroll.toElement('content1');
     });
	e.stop();
});
*/

function dropin()
{
    myslide.slideIn();
    scroll.toElement('content1');
}

function initImage(image1) {
  imageId = image1;
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}