$(document).ready(function() {         
	// call functions here
    scrollIt();
	checkFormField();
	$("a.pop").fancybox();
});
// ##### add functions below #####

$(function(){
			$('a.new-window').click(function(){
			window.open(this.href);
			return false;
			});
		});

	function scrollIt() {			// works with the scrollable js included seperately
		$("div.scrollable").scrollable({
	        size: 1,
			items: '.items',
	        clickable: true,
	        interval: 10000,
	        loop: true,  
	        speed: 600
	    });
	};


	function checkFormField() {		// gets the searchinput field's default value and 
									// checks before submission that it has been changed.
									
		var defVal = $('#searchinput').val();
		formClear();
		$('#formsearch').submit(function () {
			if ($('#searchinput').val() == defVal) {
				return false;
			};
		});
	};

	
	function formClear () {			// gets called by the script above
		
		var textContent = $('#searchinput').val();
		$('#searchinput').focus(function() {
			if (this.value == textContent) {
				$(this).val('');
			};
		}).blur(function() {
			if (this.value == '') {
				$(this).val(textContent);
			};
		});
	};