/* 

Website doot 	Tom v. Eijmeren
				Tom@van-eijmeren.nl
				
				
HIGLSLIDE CONFIGURATIE				
*/
var mem_zoek;
hs.graphicsDir = 'http://www2.jadico.nl/images/hs/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
//hs.dimmingOpacity = 0.50;

// Add the controlbar
if (hs.addSlideshow) hs.addSlideshow({
	//slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: true,
	overlayOptions: {
		opacity: .75,
		position: 'top center',
		hideOnMouseOut: true
	}
});



$(document).ready(function(){
	$("#div_head_tabs").show("slide", { direction: "down" }, 1000);			   
});

function tab_click(tab) {
	$("#div_head_tabs").hide("slide", { direction: "down" }, 1000);
	if(tab == 'jadico')
	{
		setTimeout("location='http://www2.jadico.nl/nl/jadico';", 500);
	}
	if(tab == 'wholesale')
	{
		setTimeout("location='http://www.jadico.nl/du/organisatie/';", 500);
	}
	if(tab == 'apollo')
	{
		setTimeout("location='http://www2.jadico.nl/nl/apollo';", 500);
	}
	if(tab == 'specerijen')
	{
		setTimeout("location='http://www.jadico.nl/du/organisatie/';", 500);
	}
}

//
function Save_Prd(id)
{
	document.getElementById('mnu_opgeslagen_producten').innerHTML = 'Opgeslagen producten (0)';
	$('#mnu_opgeslagen_producten').effect("pulsate", { times: 2 });
	
}

function Tab_Over(tab, kleur)
{
	document.getElementById(tab).style.background='url(http://www2.jadico.nl/jadico/images/tab_over_' + kleur + '.gif)';
}

function Tab_Kleur_Uit(tab)
{
	if(document.getElementById(tab).className == "Tab_Aan"){
		document.getElementById(tab).style.background='url(http://www2.jadico.nl/jadico/images/tabs6.gif)';
	}else{
		document.getElementById(tab).style.background='url(http://www2.jadico.nl/jadico/images/tabs4.gif)';
	}
}

function Zoek_veld_in(e)
{
	var tekst = e.value;
	
	if(tekst == "Snel zoeken..")
	{
		e.style.color = "#000000";
		e.value = "";
	}

}

function Zoek_veld_uit(e)
{
	var tekst = e.value;
	
	if(tekst == "")
	{
		e.style.color = "#333333";
		e.value = "Snel zoeken..";
	}
	
}

function menu_over(e)
{
	e.style.color = '#333333';	
}

function menu_out(e)
{
	e.style.color = '#666666';	
	
}

function page_menu_click (adres) 
{
	location='/nl/' + adres;
}

function tps_mousemove(id)
{
	document.getElementById('tps_' + id).style.bgColor = "#333333";
}

function tps_mouseout(id)
{
	document.getElementById('tps_' + id).style.bgColor = "#FFFFFF";
}

function init_ass_search()
{
	var ass_txt_zoek = document.getElementById('ass_txt_zoek').value;
	if(ass_txt_zoek == "Snel zoeken.."){ass_txt_zoek = "";}
	if(mem_zoek != ass_txt_zoek){
		var ajax = new Ajax("http://www2.jadico.nl/includes/php/producten_search.php", {
				method: "POST",
				vars: "ass_txt_zoek=" + ass_txt_zoek,
				onComplete: function(xhr)
				{
					document.getElementById('ass_resultaten').innerHTML = xhr.responseText;
					setTimeout("init_ass_search()", 200);
				}
		});
		ajax.get();
	}else{
		setTimeout("init_ass_search()", 200);
	}
	mem_zoek = ass_txt_zoek;
	
}

function init_tps_search()
{
	var ass_txt_zoek = document.getElementById('tps_txt_zoek').value;
	if(ass_txt_zoek == "Snel zoeken.."){ass_txt_zoek = "";}
	if(mem_zoek != ass_txt_zoek){
		var ajax = new Ajax("http://www2.jadico.nl/includes/php/toepassingen_search.php", {
				method: "POST",
				vars: "tps_txt_zoek=" + ass_txt_zoek,
				onComplete: function(xhr)
				{
					document.getElementById('tps_resultaten').innerHTML = xhr.responseText;
					setTimeout("init_tps_search()", 200);
				}
		});
		ajax.get();
	}else{
		setTimeout("init_tps_search()", 200);
	}
	mem_zoek = ass_txt_zoek;
	
}

function flsrs(breed)
{
	document.getElementById('div_stempel').style.width = breed + "px";
}

function checkMailform() 
{
	$Ok = "ja";
	if(checkMailFormField('txt_mail_1', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_mail_2', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_mail_5', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_mail_6', 5) == "nee"){$Ok = "nee";}
	
	if($Ok == "ja")
	{
		document.frm_Mail.submit();	
	}
}

function checkVacatureform()
{
	$Ok = "ja";
	if(checkMailFormField('txt_1', 2) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_2', 2) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_3', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_4', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_5', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_6', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_9', 5) == "nee"){$Ok = "nee";}
	
	if($Ok == "ja")
	{
		document.frm_Vacature.submit();	
	}
	
}

function checkReceptMailForm() 
{
	$Ok = "ja";
	if(checkMailFormField('txt_Van', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_Naar', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_Onderwerp', 5) == "nee"){$Ok = "nee";}
	if(checkMailFormField('txt_Bericht',20) == "nee"){$Ok = "nee";}
	
	if($Ok == "ja")
	{
		document.frm_Mail.submit();	
	}
}


function checkMailFormField (id, lengte)
{
	
	var tekst = document.getElementById(id).value;
	
	if(tekst.length < lengte)
	{
		document.getElementById(id).style.background = '#FFE6E7';
		return "nee";
	}else{
		document.getElementById(id).style.background = '';
		return "ja";
	}
	
}
