/***********************************************************
Scriptname: 	init.js
Dependencies: 	*
Version: 		n/a
Description:	Instantiating the application

Copyright: 		Webavance B.V. 2011
Legal: 			Any use of this script without Webavance B.V.
				express written consent is prohibited
************************************************************/

$(document).ready( function(){
	//$('menu').ddmenu({});
	
	newpass = $('#new_password').val('');
	

    $('#logoslides_left').cycle({
		fx: 'fade' 
	});
	
	$('#logoslides_right').cycle({
		fx: 'fade' 
	});

	//if($("div#page").length > 0) alert($("div#page").css("left"));
	
	if($("div#tabs").length > 0) {
		$("#tabs").tabs();
	}
});

function validate() {
	if ((document.getElementById('frm').postcode_start.value == "") && (document.getElementById('frm').city_start.value == "")) {
		alert ("Je dient een postcode of woonplaats in te vullen.");
		return (false);
	}
	return (true);
}

function doContinue() {
	if (!validate()) return;
	document.getElementById('frm').submit();
}

function showMore(references){
	var right_height = references * 33.3;
	var left_height = right_height + 35;
	
	$('#more_references').css('display','none');
	$('#second_block').css('display','block');
	$('#middle').css('height',right_height+'px');
	$('#nav_block1').css('height',left_height+'px');
	$('#nav_block2').css('height',left_height+'px');
}

function showMoreOnVacancies(references){
	height = references * 33.3;
	
	$('#more_references').css('display','none');
	$('#second_block').css('display','block');
	$('#middle').css('height',height+'px');
}

function searchSubmit(){
	if(document.getElementById('frm').keyword.value == ""){
		alert('U dient een trefwoord in te vullen');
	} else {
		document.getElementById('frm').submit();
	}
}
