

var headline_width;


function headline_scroller() {
    $('#news-slide span.ScrollThis').css({'left' : headline_container_width +'px'});
  $('#news-slide span.ScrollThis p').animate({left: -headline_width },30000, "linear", function() {

headline_scroller();
	});
  
}





function makeTall(){  $('.SiteSearch').stop().fadeIn('slow');$('.SiteSearch .FormField').focus()}
function makeShort(){ $('.SiteSearch').stop().fadeOut('slow');}
function Nothing(){ return false;}


function adjustWidth(){ 
 $( "div.scrollable div.items p" ).each(   
  function () {
			// For each hottie, run this code.
			w = ($("#USPS.USPS_Main li").width())-12;
				$('#USPS.USPS_Main td').css({'width': w });
				 $(this).css({'width': w });
  }
  );
}

    function Caroussel() {
	
	 $.timer(200, function (timer) {
  
  	$("#jCarouselLiteDemo").jCarouselLite({
		    btnNext: "#jCarouselLiteDemo .next"
		    , btnPrev: "#jCarouselLiteDemo .prev"
			, visible: 3
			, speed: 500
			, vertical: true
			, mouseWheel: true
			, circular: false
		});
		
  
  
  	timer.stop();
 });
 
  return false;
    }
  
	  

function Scrollto (anchorName) {
var anchor = document.getElementById(anchorName);
var coords = {x: 0, y: 0 };
coords.x += anchor.offsetLeft;
coords.y += anchor.offsetTop;
window.scrollTo(coords.x , coords.y);
}

function MoveTab(num)
{
var container = $find('ctl00_cphTekst_Tabs');
container.set_activeTabIndex(num);
}

    var map = null;
    var geocoder = null;

    function initialize() {
      if (GBrowserIsCompatible()) {
	 container = document.getElementById("map_canvas");
	 width = parseInt(container.style.width);
	 height = parseInt(container.style.height);
	 map = new GMap2(container, {size:new GSize(width,height)}); 
     geocoder = new GClientGeocoder();
	 
      }
    }

	
    function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
			
			
              map.setCenter(point, 13);
			 
			  
              var marker = new GMarker(point);
			  
              map.addOverlay(marker);
			  //marker.openInfoWindowHtml(address);
              //marker.openInfoWindow(address);
		 
			marker.showMapBlowup(address);
			map.addControl(new GSmallMapControl());
			  
            }
          }
        );
      }
    }
 
 
 
 
 
 $(document).ready(function() {


 

	
 //for USP page
 
adjustWidth();

$('div#news-slide').show();



     var resizeTimer = null;
		$(window).bind('resize', function() {
			if (resizeTimer) clearTimeout(resizeTimer);
			resizeTimer = adjustWidth();
     });
	  
	  
	  
	  
	   
   //scroller
  
  $('div#news-slide').show();



headline_width = $('#news-slide p').width();
headline_container_width = $('#news-slide').width();








 //$( '#news-slide p' ).bind (
	//	 "mouseover mouseout",
		// function(){
		 
		
		// $('#news-slide p').stop();
		 
		// },
		//  function(){
		 
		
		
		 
	//	 }
		 
	//	 );
		 
		 
headline_scroller();

//  $(document).pngFix();

$('#carousel_aanbod_wrapper, #carousel_voorbereiding_wrapper ').show();


$("#USPS.USPS_Main .scrollable").scrollable({ 
size: 1 
,naviItem: "p"
,keyboard: true
,loop: true
,next: ".ReadMore"
});

//caroussel
$('#carousel_aanbod').show();
$('.ajax').hide();
$('#carousel_aanbod').jCarouselLite({
auto: 3000,
speed: 3000,
visible: 1,
scroll:1,
easing: "easeInOutBack",
mouseWheel: true
});

$('#carousel_voorbereiding').show();	
$('.ajax').hide();
$('#carousel_voorbereiding').jCarouselLite({
auto: 3000,
speed: 3000,
visible: 1,
scroll:1,
easing: "easeInOutBack",
mouseWheel: true
});





			//search

   
   var configIn = {    
     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
     interval: 0, // number = milliseconds for onMouseOver polling interval    
     over: makeTall, // function = onMouseOver callback (REQUIRED)    
     timeout: 1500, // number = milliseconds delay before onMouseOut    
     out: Nothing // function = onMouseOut callback (REQUIRED)    
};

   var configOut = {    
     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
     interval: 0, // number = milliseconds for onMouseOver polling interval    
     over: Nothing, // function = onMouseOver callback (REQUIRED)    
     timeout: 1500, // number = milliseconds delay before onMouseOut    
     out: makeShort // function = onMouseOut callback (REQUIRED)    
};

$('.SiteSearchTrigger').hoverIntent( configIn );
$('.SiteSearch').hoverIntent( configOut );

// misc
 	$('.Email').safermailto();  // email cloaking
	
	
	//selectboxes

 $('.Select').selectbox({ inputClass: 'selectbox', containerClass: 'selectbox-wrapper', hoverClass: 'current', currentClass: 'selected', debug: false   }    ); 

		//search





 });