$(document).ready(function(){

	// flash inladen
	// als een div aangemaakt wordt met als class "flash",
	// en als inhoud het absolute pad naar de flash en de variable
	// wordt deze automatisch ingeladen
	$('.flash').each(function(){
		slideshowvars = $(this).find('.flashlink').html();
		slideshowheight = $(this).css('height');
		slideshowwidth = $(this).css('width');
		$(this).html("");
		$(this).flash({
	    	src: slideshowvars,
	    	width: slideshowwidth,
	    	height: slideshowheight
		});
	});

	// links in "_blank" i.p.v. via HTML i.v.m. valid XHTML
	$('.blankwindow').attr('target','_blank');


	$('.language_box').change(function(){
		if($(this).val()=='nl')
		{
			document.location='http://www.neptunus.eu';
		}
		if($(this).val()=='de')
		{
			document.location='http://www.neptunus.de';
		}
		if($(this).val()=='en')
		{
			document.location='http://www.neptunus.co.uk';
		}
		if($(this).val()=='es')
		{
			document.location='http://www.neptunus.es';
		}
		if($(this).val()=='fr')
		{
			document.location='http://www.neptunus.fr';
		}
		if($(this).val()=='pl')
		{
			document.location='http://www.neptunus.pl';
		}
		//document.location='/'+$(this).val();
	});

	$('#gallery a').lightBox({
		fixedNavigation:true,
		imageLoading: '/public/img/lightbox/lightbox-ico-loading.gif' ,
		imageBtnClose: '/public/img/lightbox/lightbox-btn-close.gif' ,
		imageBtnPrev: '/public/img/lightbox/lightbox-btn-prev.gif' ,
		imageBtnNext: '/public/img/lightbox/lightbox-btn-next.gif'
	});

	$('.menu_li').mouseover(function(){
		//$('.submenu').hide();
		$(this).find('.submenu').show();

//		$(this).find('.submenu').mouseout(function(){
//			$(this).hide();
//		})
	});

	$('.menu_li').mouseout(function(){
		//alert('weg');
		$('.submenu').hide();
	});

	$("#contact_titel").click(function(){
		$("#contact_product").slideDown();
	});



	$('.customform_holder form').submit(function(){

		var customform = $(this);
		var customform_hoder = $(this).parents('.customform_holder');

		$(this).ajaxSubmit({
			dataType: 'json',
			success: function(data){
				if (data.success) customform_hoder.html(data.message);
				else alert(data.message);
			}
		});
		return false;
	});



});