$(function(){
	setPortalHeight();   
	
    /* Lightbox */
	$('a.lightbox').lightBox({
	
		overlayBgColor: '#000',
		overlayOpacity: 0.5,
		imageLoading: '/ENGINE/IMAGES/INDUSTRIAL_TOURISM/WEBSITE/lightbox/lightbox-ico-loading.gif',
		imageBtnClose: '/ENGINE/IMAGES/INDUSTRIAL_TOURISM/WEBSITE/lightbox/lightbox-btn-close.gif',
		imageBtnPrev: '/ENGINE/IMAGES/INDUSTRIAL_TOURISM/WEBSITE/lightbox/lightbox-btn-prev.gif',
		imageBtnNext: '/ENGINE/IMAGES/INDUSTRIAL_TOURISM/WEBSITE/lightbox/lightbox-btn-next.gif',
		txtImage: 'Afbeelding',
		txtOf: 'van'
	});   	
	
	/* Pageselector hide empty */
	if($('div.content-page-selector').length)
		if(!$('td.content-page-selector-number').html())
			$('div.content-page-selector').hide();	
			
	$('tr.row-1').hover(
		function(){$(this).css({backgroundColor:'#f5f5f5'});},
		function(){$(this).css({backgroundColor:'#FFF'});
	});
});

function setPortalHeight()
{
	height_i = $('div.content-portal-item > div.content-portal-tour > div.inner').height();
	$('div.content-portal-item > div.inner > div.text').each(function(){
		height_i = height_i > $(this).height() ? height_i : $(this).height();
	});
	$('div.content-portal-item > div.content-portal-tour > div.inner > div.text').height(height_i-20);
	$('div.content-portal-item > div.inner > div.text').height(height_i);
}


function storeData(form_o, name_s)
{									
	default_return_value = getValidation(form_o);
	if(default_return_value == true)
	{
		$.ajax
		({
			type: 'POST',
			async: false,
			url: '/industrial_tourism/form_data',
			data: {data : $('form[name="'+name_s+'"] :input').serializeArray()},
			success: function(data)
			{			
				if(data)
					return true;
			},
			error: function (XMLHttpRequest, textStatus, errorThrown)
			{return false;}
		});	
	}
	else{
		return false;
	}
}

