$(function(){ 
 	$.fn.supersized.options = { 
 		startwidth: 1200, 
 		startheight: 750, 
 		vertical_center: 1, 
 		slideshow: 0, 
 		navigation: 0, 
 		transition: 0, //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left 
 		pause_hover: 0, 
 		slide_counter: 0, 
 		slide_captions: 0, 
 		slide_interval: 9999
 	}; 
 	$('#supersize').supersized();
 	
}); 

var scroller="scrollvlak";
var currentImg, tc, count, myUrl;
$(document).ready(function(){
	//$('#wrapper').supersleight({shim: '../images/x.gif.gif'});
	
	if(scroller!="") {
		
		$(function()
		{
			//$('#'+scroller).jScrollPane({scrollbarWidth:7, scrollbarMargin:10, dragMaxHeight:23, dragMinHeight:23});
			
			$('#frontimage').cycle({ 
 				fx:     'fade', 
 				speed:  'fast', 
				slideExpr:		'img',  //only look for 'img'-element
				timeout: 0, 
  				pager:  '#scrollvlak', 
     
 			   // callback fn that creates a thumbnail to use as pager anchor 
 			   pagerAnchorBuilder: function(idx, slide) { 
   			     return '<a href="#"><img src="' + slide.src + '" class="thumb" width="120" height="80" /></a><br />'; 
  			  } 
			});

			$('#frontimage').cycle({
				fx:				'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
				timeout:		0,  // milliseconds between slide transitions (0 to disable auto advance)
				speed:			300,   // speed of the transition (any valid fx speed value)
				slideExpr:		'img',  //only look for 'img'-element
				next:			'#nextslide',
				prev:			'#prevslide'
				
				//pager:         '#scrollvlak', 
			    //pagerAnchorBuilder: function(idx, slide) { 
			        // return selector string for existing anchor 
			    //    return '#scrollvlak dl:eq(' + idx + ') a'; 
			    //}
			});
			
			
			
			
			
			$('#'+scroller).jScrollPane({scrollbarWidth:7, scrollbarMargin:10, dragMaxHeight:23, dragMinHeight:23});

			//$('#'+scroller+' dl img').wrap(document.createElement("a"));
			//$('#'+scroller+' dl a').attr({'href': '#'});


			$('#slideshow').click(function(){ 
				$('#frontimage').cycle({
					fx:				'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
					timeout:		2000,  // milliseconds between slide transitions (0 to disable auto advance)
					speed:			300,   // speed of the transition (any valid fx speed value)
					slideExpr:		'img',  //only look for 'img'-element
					next:			'#nextslide',
					prev:			'#prevslide'
				});
			});


		});
	}
	
	$(".toplink").click(function(){ 
		var h = $("body").height(); 
		//alert (h); 
		$("body").animate({ scrollTop: h }, "slow"); 
		//  return false; 
	});
	 
	 
	$(function(){
		positionFooter(); 
		function positionFooter(){
	
		//alert($("#mainContent").height());
		//alert($("#header").height());
		//alert($(window).height());
		
		
		var contentHeight = $("#mainContent").height()+$("#header").height()+$("#footer").height();
		var windowHeight = $(window).height();
		var headerHeight = $("#header").height();
	
		if (contentHeight < windowHeight) {
			$("#footer").css({position: "absolute",top:($(window).scrollTop()+$(window).height()-$("#footer").height())+"px"})	
		}else {
			$("#footer").css({position: "absolute",top:($("#mainContent").height()+$("#header").height()+19)+"px"})	
		}
		
 	}
 	
	$(window)
		.scroll(positionFooter)
		.resize(positionFooter)
	});

});












function doNuhn() {}
					
function changeBG(elementId,setTo) 
{

								// checker = 1;
								if( document.getElementById ) 
								{
									var theElement = document.getElementById( elementId );
								}
								
								else 
								{
									if( document.all )
									{
										// Proprietary DOM
										var theElement = document.all[ elementId ];
									}
									else
									{
										// Create an object to prevent errors further on
										var theElement = new Object();
									}
								}
								
								if( !theElement )
								{
									// The page has not loaded or the browser claims to support
									// document.getElementById or document.all but cannot actually
									// use either
									return;
								}
		    
								//Reference the style ...
								if( theElement.style )
								{
									theElement = theElement.style;
								}
								
								if( typeof( theElement.display ) == 'undefined' && !( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) )
								{
									//The browser does not allow us to change the display style
									//Alert something sensible (not what I have here ...)
									window.alert( 'Your browser does not support this' );
									return;
								}
					
									//Change the display style
									theElement.background = setTo;
									//alert(document.getElementById('book').style.background);
									document.getElementById("frontimage").style.display = "none";

							/*}
							catch(e)
							{}*/
}



