
	//add pager to container
	
	if ($('div.page').length > 1) {
		if($('div.page').parent().hasClass('tabs') === false)	{
			//$('<dl class="pages bottom"><dt>Page:<dt><dd><ul></ul></dd></dl>').appendTo('#footer');
			//$('<dl class="pages top"><dt>Page:<dt><dd><ul></ul></dd></dl>').insertAfter('#decoration_container, #infobank_container');
			$('<hr /><dl class="pages bottom"><dt>Page:</dt></dl><hr />').appendTo('#content');
			//$('<dl class="pages top"><dt>Page:</dt></dl>').prependTo('#content');
	
			$('div.page').each(function(index){
				$(this).attr('id', 'page_' + (index + 1));
				if((index + 1) < $('div.page').length)	{
					$('<dd class="page_trigger_' + (index + 1) + '"><a href="#">' + (index + 1) + '</a><span>/</span></dd>').appendTo('.pages');
				}
				else	{
					$('<dd class="page_trigger_' + (index + 1) + '"><a href="#">' + (index + 1) + '</a></dd>').appendTo('.pages');
				}
			});
		
	   
	    //set first tab active on initialization.
	    $('dl.pages dd.page_trigger_1').addClass('active');
	    //$('div.image_container:first').show();
	    $('div.page').hide();
	    $('div.page:first').show();
	  }
      if ($("body#custom_presets").length > 0) {
					$("#overview_text").hide();
					$('dl.pages a:eq(0)').bind('click',function(){
					    $("#overview_text").hide();
					    return false;
					});
					$('dl.pages a:eq(1)').bind('click',function(){
					    $("#overview_text").hide();
					    return false;
					});
					$('dl.pages a:eq(2)').bind('click',function(){

					    $("#overview_text").show();
					    changeVid('intro_video.flv','Custom Presets – here you can watch a tutorial about creating, modifying, saving, and exchanging Custom Presets using Canon camcorders. You can also watch clips showing the examples of the 23 Custom Preset properties and watch and download 10 Custom Presets that have been specially produced for CPN by filmmaker Bart Verdult.');
					    return false;
					});
					$(document.body).click(function()	{
						$('.custom_presets_nav_box').hide();
					});
					$('a.custom_presets_nav_link').click(function()	{
						$('a.custom_presets_nav_link').not(this).parent().next().hide();
						$(this).parent().next().toggle("slow",function(){$(".custom_presets_nav_box").css("filter","alpha(opacity=85)")});
						return false;
					});

	  }
	}
    
	$('dl.pages a').click(function(){

		        var pageNumber = $(this).text();
		        
			//set current active tab and page 
		        $('dl.pages dd').removeClass('active');
		        $('dl.pages dd.page_trigger_' + (pageNumber)).addClass('active');
		        $('div.page').hide();
		        $('div#page_' + (pageNumber)).show();
                var trackCode = window.location.href + '#page-' + pageNumber;
                pageTracker4Q._trackPageview(trackCode);
			   
		    // Safari
		    var pos = $("div#content").position();
		        window.scrollTo(0, pos.top);
		
		    	/** we kunnen dit een keer proberen..
		    	if($.browser.safari) {
		    	    window.location.replace(window.location.hash);
		    	}
		    	*/
		       
		        return false;
        
	});


