var ProjectButton = new Class({
	
	Extends : Button,
	
	initialize : function(e,c)
	{
		this.vo = eval("(" + e.id + ")");
		this.setElement(e);
		this.setController(c, this.vo.event);
		
		doRounded(this.e, "transparent", this.vo.backgroundColor);
		this.t = new Fx.Morph(this.e.childNodes[0], {duration:'normal', transition:'cubic:out'});
	},
	
	gotoLocation : function()
	{
		window.location = this.vo.url;
	},
	
	doMouseover: function()
	{
		this.e.style.cursor = 'pointer';
		this.t.cancel();
		this.t.start({'paddingTop':[10]});
	},
	
	doMouseout: function()
	{
		this.e.style.cursor = 'default';
		this.t.cancel();
		this.t.start({'paddingTop':[0]});
	}
	
	
})

var EventButton = new Class({
	
	Extends : Button,
	
	initialize : function(e,c)
	{
		this.vo = eval("(" + e.id + ")");
		this.setElement(e);
		this.setController(c, this.vo.event);
		this.t = new Fx.Morph(this.e.childNodes[0], {duration:'normal', transition:'cubic:out'});
	},
	
	gotoLocation : function()
	{
		window.location = this.vo.url;
	},
	
	doMouseover: function()
	{
		this.e.style.cursor = 'pointer';
		this.t.cancel();
		this.t.start({'paddingTop':[10]});
		//this.t.start({'background-color':'#ffeeee'});
	},
	
	doMouseout: function()
	{
		this.e.style.cursor = 'default';
		this.t.cancel();
		this.t.start({'paddingTop':[0]});
		//this.t.start({'background-color':'#ffffff'});
	}
	
	
})

var NewsletterButton = new Class({
	
	Extends : Button,
	
	bgImageOver: 'http://vredevanutrecht.com/_stamp/img/rightOver.png',
	bgImageOut: 'http://vredevanutrecht.com/_stamp/img/rightOut.png',
	
	initialize : function(e,c)
	{
		this.setElement(e);
		this.e.setStyles
		({
			'background':'url("'+this.bgImageOut+'") no-repeat center right'
		 })
	},
	
	gotoLocation : function()
	{
		window.open('http://www.mailinglijst.nl/nieuwsbrief/subscribe.asp?l=508','newsletter','width=500,height=600,scrollbars=yes,toolbar=no,location=no'); 
	},
	
	doMouseover: function()
	{
		this.e.setStyles
		({
			'cursor':'pointer',
			'background':'url("'+this.bgImageOver+'") no-repeat center right'
		})
	},
	
	doMouseout: function()
	{
		this.e.setStyles
		({
			'cursor':'pointer',
			'background':'url("'+this.bgImageOut+'") no-repeat center right'
		})
	},
	
	doClick: function()
	{
		this.gotoLocation();
	}
	
})

var HomeButton = new Class({
	
	Extends : Button,
	
	bgImageOver: 'http://vredevanutrecht.com/_stamp/img/rightOver.png',
	bgImageOut: 'http://vredevanutrecht.com/_stamp/img/rightOut.png',
	
	initialize : function(e,c)
	{
		this.setElement(e);
		this.e.setStyles
		({
			'background':'url("'+this.bgImageOut+'") no-repeat center right'
		 })
	},
	
	gotoLocation : function()
	{
		window.location = 'http://vredevanutrecht.com/';
	},
	
	doMouseover: function()
	{
		this.e.setStyles
		({
			'cursor':'pointer',
			'background':'url("'+this.bgImageOver+'") no-repeat center right'
		})
	},
	
	doMouseout: function()
	{
		this.e.setStyles
		({
			'cursor':'pointer',
			'background':'url("'+this.bgImageOut+'") no-repeat center right'
		})
	},
	
	doClick: function()
	{
		this.gotoLocation();
	}
	
})

var RoundedRectangleButton = new Class({
	
	Extends : Button,

	bgImageOver: 'img/rightOver.png',
	bgImageOut: 'img/rightOut.png',
	textColor: 'black',
	bgColor: 'white',
	
	initialize : function(e,c)
	{
		this.setElement(e);
		this.url = this.e.get('href');
		if(!NiftyCheck())
		{
			return;
		}else{
			var h = this.e.get('html');
			this.e.set('html', '');
			this.inner = new Element('p',{styles:{'padding':'0 10px', 'margin':'0', 'background':this.bgColor}});
			this.inner.inject(this.e);
			this.innerMost = new Element('p',{html:h, styles:{'margin':'0','padding':'1px 30px 1px 0', 'color':this.textColor, 'font-size':'11px','font-weight':'bold', 'background':'url("'+this.bgImageOut+'") no-repeat center right','text-transform':'uppercase'}});
			this.innerMost.inject(this.inner);
			this.outer = new Element('p',{styles:{'clear':'both'}});
			this.outer.wraps(this.e);
			//this.outer.setStyle('opacity', '.7');
		}
	},
	
	gotoLocation : function()
	{
		window.location = this.url;
	},
	
	doMouseover: function()
	{
		//this.outer.setStyle('opacity', '1');
		this.innerMost.setStyles
		({
			'cursor':'pointer',
			'background':'url("'+this.bgImageOver+'") no-repeat center right'
		})
	},
	
	doMouseout: function()
	{
		//this.outer.setStyle('opacity', '.7');
		this.innerMost.setStyles
		({
			'cursor':'pointer',
			'background':'url("'+this.bgImageOut+'") no-repeat center right'
		})
	},
	
	doClick: function()
	{
		this.gotoLocation();
	}
})

var MoreButton = new Class({
	
	Extends : RoundedRectangleButton,
	bgImageOver: 'img/rightOver.png',
	bgImageOut: 'img/rightOut.png',
	textColor: 'black',
	bgColor: 'white'
})

var DownloadButton = new Class({
	
	Extends : RoundedRectangleButton,
	bgImageOver: 'img/downOver.png',
	bgImageOut: 'img/downOut.png',
	textColor: 'black',
	bgColor: 'white'
})

