function search(searchkeys, page)
{

	document.location.href= ((page == undefined ) ? "/zoeken.aspx?s=" : page + "s=") + searchkeys;
}



function searchPlace(searchkeys)
{
	document.location.href="/aardgasvulstations/overzicht-vulstations/bij-mij-in-de-buurt.aspx?s=" + searchkeys;
}

function got(id, city)
{
	location.href='/aardgasvulstation/' +id + '/' +city+ '.aspx';
}

function printpage()
{
	window.print();
}

function openpopup( url ){
    $.fancybox({
	'type'		  : 'iframe',
	'href'	  	  : url,
        'autoDimensions'  : true,
        'height'          : 500,
        'width'           : 700,
        'showCloseButton' : true,
        'transitionIn'    : 'slow',
        'transitionOut'   : 'slow'
    });
}

function opentankstation( id , city ) {
  var c = getCultureCode();
  var page = getTankStationPage(c);
  if (c != '') c = '/' + c;
  
  openpopup(  c + '/' + page + '/' + id + '/' + city + '.aspx' );
}



$(document).ready(function() {
	//verberg routeplanner
	if (getCultureCode() != '')
	{
		$(".routeplannereuropa").hide();
	}

    //$('#contentleftbanner').cycle({
	//	fx: 'fade',
	//	timeout: 10000,
	//	random: 1
	//});
	if( $('#topimage').length )
	{
		$('#topimage').cycle({
			fx: 'fade',
			timeout: 8000
		});
	}
	if( $('#topimage').length )
	{
		$('.slideshow').cycle({
			  fx: 'fade',
		 	 random: 1
		});
	}
	var light = $('.lightbox') ;
	if( light.length )
		$('.lightbox').lightBox();
		
});

function getCultureCode()
{
	var url = window.location.href;
	var c = ''; //nl
	if (url.indexOf('/en/') > -1)
		c = 'en';
	else if (url.indexOf('/de/') > -1)
		c = 'de';
		
	return c;
}

function getTankStationPage(c)
{
	if (c == '') return 'aardgasvulstation';
	if (c == 'de') return 'erdgasstation';
	if (c == 'en') return 'natural-gasstation';
}
