var sIFR;

function nospam(name, domain, toplevel) {
	mailadd = "mailto:" + name + "@" + domain + "." + toplevel;
	window.location = mailadd;
}

window.addEvent('domready', function() {
	
	var tooltips = new Tips($$('.tooltip'), {
	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);
	}
	});
	
	var feats = new Tips($$('.feats'), {
	initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
	},
	offsets: {'x': 20, 'y': -210},
	onShow: function(toolTip) {
		this.fx.start(1);
	},
	onHide: function(toolTip) {
		this.fx.start(0);
	}
	});
	
	/*var object = $('logo').getElement('h1');
		var objectfx = new Fx.Styles(object, {duration: 1000, 'transition': Fx.Transitions.Elastic.easeOut});
		new Drag.Base(object, {
			onComplete: function(){
				objectfx.start({'top': 0, 'left': 0});
			}
	});*/
	
	 $$('.pr').each(function(el) {  
         el.setStyle('opacity', 0.7);
     }); 
	
	//Scroll
	new SmoothScroll({ duration: 1000 });
	
	//Header
	var slide_headertext = new Fx.Slide('header-text', {duration: 1000, mode: 'horizontal'});
    slide_headertext.hide().slideIn.delay(0, slide_headertext);
    
    
    //Slide Boxes
    /*var slide_boxes = new Fx.Slide('footer', {duration: 1000});
    slide_boxes.hide().slideIn.delay(0, slide_boxes);*/
    
    //Slide in
    $$('.feats').each(function(el) {
        new Fx.Style(el.setStyles({ display:'block', opacity: 0}), 'opacity', {duration: 0} ).start(0);
     });
     
    $$('#work').each(function(el) {
       new Fx.Style(el.setStyles({ display:'block', opacity: 0}), 'opacity', {duration: 0} ).start(0);
    });
     
     
    (function(){ new Fx.Elements($$('#work'), {duration:2000, wait: false}).start({
		'0': { 'opacity': [0.00001, 1.0] }}); }).delay(500);
		
		
    
    (function(){ new Fx.Elements($$('.feats'), {duration:2000, wait: false}).start({
		'0': { 'opacity': [0.00001, 1.0] }}); }).delay(0);

	(function(){ new Fx.Elements($$('.feats'), {duration:2000, wait: false}).start({
		'1': { 'opacity': [0.00001, 1.0] }}); }).delay(100);
		
	(function(){ new Fx.Elements($$('.feats'), {duration:2000, wait: false}).start({
		'2': { 'opacity': [0.00001, 1.0] }}); }).delay(200);
	
	(function(){ new Fx.Elements($$('.feats'), {duration:2000, wait: false}).start({
		'3': { 'opacity': [0.00001, 1.0] }}); }).delay(300);
		
	(function(){ new Fx.Elements($$('.feats'), {duration:2000, wait: false}).start({
		'4': { 'opacity': [0.00001, 1.0] }}); }).delay(400);
		
	(function(){ new Fx.Elements($$('.feats'), {duration:2000, wait: false}).start({
		'5': { 'opacity': [0.00001, 1.0] }}); }).delay(500);
		
	(function(){ new Fx.Elements($$('.feats'), {duration:2000, wait: false}).start({
		'6': { 'opacity': [0.00001, 1.0] }}); }).delay(600);
		
	(function(){ new Fx.Elements($$('.feats'), {duration:2000, wait: false}).start({
		'7': { 'opacity': [0.00001, 1.0] }}); }).delay(700);
	
});



/*window.addEvent('load', function () {	
	
	var slide_headertext = new Fx.Slide('header-text', {duration: 1000, mode: 'horizontal'});
    slide_headertext.hide().slideIn.delay(0, slide_headertext);
    
});*/



function blurin(element) {
	var myElementsEffects = new Fx.Elements($$(element));
	myElementsEffects.start({
    '0': { 'opacity': [0.7, 1.0] }
});	
}

function blurout(element) {
	var myElementsEffects = new Fx.Elements($$(element));
	myElementsEffects.start({
    '0': { 'opacity': [1.0, 0.7] }
});	
}


/*
function showpic(element, img) {
	var myElementsEffects = new Fx.Elements($$(element));
	myElementsEffects.start({
    	'0': { 'opacity': [0.0, 1.0] }
	});
}

function hidepic(element, img) {
	var myElementsEffects = new Fx.Elements($$(element));
	myElementsEffects.start({
    	'0': { 'opacity': [1.0, 0.0] }
	});	
}
*/
