jQuery(document).ready(function($) {	
	$('.flexslider').flexslider({
			animation: "fade",              //Select your animation type (fade/slide)
			slideshow: true,                //Should the slider animate automatically by default? (true/false)
			slideshowSpeed: 9000,           //Set the speed of the slideshow cycling, in milliseconds
			animationDuration: 600,         //Set the speed of animations, in milliseconds
			directionNav: false,             //Create navigation for previous/next navigation? (true/false)
			controlNav: true,               //Create navigation for paging control of each clide? (true/false)
			controlsContainer: ".flexcontroller",          //Advanced property: Can declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken.
			pauseOnAction: true,            //Pause the slideshow when interacting with control elements, highly recommended. (true/false)
			pauseOnHover: true,            //Pause the slideshow when hovering over slider, then resume when no longer hovering (true/false)
    });
	
	$("#query").tweet({
		avatar_size: 32,
		count: 5,
		query: ["#rsngelukwens"],
		loading_text: " ",
		refresh_interval: 20
	});
	
	$("#cloudvirtualisatie,#hostinghousing,#ipnetworksolutions,#nieuws-logo,#marktoplossingen-logo,#streamingvoip-logo,#aanbiedingen-logo,#offerte-logo,#vacatures-logo,#login-logo,#contact-logo").mouseover(
		function () {
			$(this).find('.blok-background-hover').fadeOut(200);
		});
		
	$("#cloudvirtualisatie,#hostinghousing,#ipnetworksolutions,#nieuws-logo,#marktoplossingen-logo,#streamingvoip-logo,#aanbiedingen-logo,#offerte-logo,#vacatures-logo,#login-logo,#contact-logo").mouseleave(
		function () {
			$(this).find('.blok-background-hover').fadeIn(200);
		});
	
	$.localScroll();
	
	$('form.iphorm').iPhorm();
	
	// Tooltip settings
	if ($.isFunction($.fn.qtip)) {
		$('.iphorm-tooltip').qtip({
			content: {
				text: false
			},
			style: {
				classes: 'ui-tooltip ui-tooltip-shadow',
				width: '180px'
			},
			position: {
				my: 'left center',
				at: 'right center'
			}
		});
	}
	
	// Changes subject to a text field when 'Other' is chosen
	var subjectHtml = $('.subject-input-wrapper').html();	
	$('#subject').live('change', function () {		
		if ($(this).val() == 'Other') {
			$('.subject-input-wrapper').empty();
			newHtml = $('<input name="subject" type="text" id="subject" value="" />');
			$('.subject-input-wrapper').html(newHtml);
			$cancelOther = $('<a>').click(function () {
				$('.subject-input-wrapper').empty();
				$('.subject-input-wrapper').append(subjectHtml);
				$(this).remove();
				return false;
			}).attr('href', '#').addClass('cancel-button').attr('title', 'Cancel');
			newHtml.after($cancelOther);
		}
	});
}); // End document ready

//Image preloader
/*
var images = new Array(
	'iphorm/images/close.png',
	'iphorm/images/success.png'
);
var imageObjs = new Array();
for (var i in images) {
	imageObjs[i] = new Image();
	imageObjs[i].src = images[i];
}
*/
