// JavaScript Document by Bolle Media
$(document).ready(function(){
	
// Menu
$("#menu").droppy();

// Contactform
$("#textarea").elastic();

// Validation
$('#contactform').validation();
$('#routeform').validation();
$('#zoekform').validation();

// Fader
$('#homefade').innerfade({
	speed: 'slow',
	timeout: 5000,
	type: 'random_start',
	containerheight: '500px'
});

// Prettyphoto
$("a[rel^='imageview']").prettyPhoto({
	theme: 'light_rounded'
});

// BMshow
$(".bmshow img").fadeTo("slow", 0.5);
		
$(".bmshow img").hover(function() {
	$(this).fadeTo("300",1.0);
	var titel = '<h1 class="sifrproject">Project</h1>'+$(this).attr('title');
	
	$(".projecten_titel").html(titel);
	$(".projecten_home").hide();
	$(".projecten_titel").show();
	},
	function() {
	$(this).fadeTo("300",0.5);
	var titelnieuw = '<h1 class="sifrproject">Projecten</h1>Hier vindt u een overzicht van diverse projecten die wij hebben afgerond. Klik op een afbeelding voor meer informatie.<br /><br /><a href="projecten/overzicht">Klik hier voor meer projecten</a>';
	
	$(".projecten_titel").hide();
	$(".projecten_home").show();
});

// BMshow
var move = -8;
var zoom = 1.1; //zoom percentage, 1.2 =120%

$('.boxhomea').hover(function() {
	width = $('.boxhome').width() * zoom;
	height = $('.boxhome').height() * zoom;
	$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200}); 	//Move and zoom the image
},
function() {
	$(this).find('img').stop(false,true).animate({'width':$('.boxhome').width(), 'height':$('.boxhome').height(), 'top':'0', 'left':'0'}, {duration:100}); 	//Reset the image
});
$('.box').hover(function() {
	width = $('.box').width() * zoom;
	height = $('.box').height() * zoom;
	$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200}); 	//Move and zoom the image
},
function() {
	$(this).find('img').stop(false,true).animate({'width':$('.box').width(), 'height':$('.box').height(), 'top':'0', 'left':'0'}, {duration:100}); 	//Reset the image
});

// Tekstgrootte
$("#up").fontscale("div","up",{unit:"px",increment:1});
$("#down").fontscale("div","down",{unit:"px",increment:1});
$("#reset").fontscale("div","reset");
/*
var originalFontSize = $('div').css('font-size');

$("#fontstandaard").click(function(){
	$('div').css('font-size', originalFontSize);
});
$("#fontgroter1").click(function(){
	var currentFontSize = $('html').css('font-size');http://localhost/koenen/img/headers/7.jpg
	var currentFontSizeNum = parseFloat(currentFontSize, 10);
	var newFontSize = currentFontSizeNum*1.1;
	$('div').css('font-size', newFontSize);
	return false;
});
$("#fontgroter2").click(function(){
	var currentFontSize = $('html').css('font-size');
	var currentFontSizeNum = parseFloat(currentFontSize, 10);
	var newFontSize = currentFontSizeNum*1.2;
	$('div').css('font-size', newFontSize);
	return false;
});
*/


/*
// Sifr 3
var font = {
	src: 'inc/sifr/corbel.swf'
};

sIFR.activate(font);
sIFR.replace(font, {
	selector: 'h1.sifr',
	css: ['.sIFR-root { color:#FFFFFF; font-size:30px; }'],
	wmode: 'transparent'
});
sIFR.replace(font, {
	selector: '.h1.sifrproject',
	css: ['.sIFR-root2 { color:#2e77b2; line-height:20px; font-size:18px; }'],
	wmode: 'transparent'
});
*/
// Homemenu
$("#homeblock_1").mouseover(function()
	{
	if($("#homeblock_1 p:first").is(":hidden"))
		{
		// $("#homeblock_1 p").show();
		$("#homeblock p").css({ display : 'none' });
		$("#homeblock").css({ opacity : '0.8' });
		$("#homeblock h2").css({ color : '#5d5d5d' });
		$("#homeblock_1").css({ opacity : '1.0'});
		$("#homeblock_1 p").css({ display : 'block' });	
		$("#homeblock_1 h2").css({ background : '#FFFFFF', color : '#f57939'});	
		// $(this).css({'background-color' : '#666666'});
		}
	else
		{
		// $("#homeblock_1 p").slideUp("slow");
		$("#homeblock_1 p").css({ display : 'none'});
		$("#homeblock p").css({ display : 'block' });
		$("#homeblock_1").css({ opacity : '0.8' });
		$("#homeblock h2").css({ color : '#f57939' });
		$("#homeblock").css({ opacity: '1' });
		$("#homeblock_1 h2").css({ background : '#5d5d5d', color : '#FFFFFF'});
		}
}).mouseout(function() 
	{
	// $("#homeblock_1 p").slideUp("slow");
	$("#homeblock_1 p").css({'display' : 'none'});
	$("#homeblock p").css({ display : 'block' });
	$("#homeblock_1").css({ opacity : '0.8' });
	$("#homeblock h2").css({ color : '#f57939' });
	$("#homeblock").css({ opacity: '1' });
	$("#homeblock_1 h2").css({ background : '#5d5d5d', color : '#FFFFFF'});
});
});
