
	
	function formatThumbs() {
		
		
		for (i=1;i<=3;i++) {
			$('#thumb_'+i+' p').addClass('transp_back');
			$('#thumb_'+i+' p').css({
				'margin' : '0px 5px',
				'padding' : '3px 5px',
				'color': '#eee'
			});
		}
		
		
					
			
		$("#hidden_menu").css({
			"display" : "none",
			"width": "auto",
			"height": "auto",
			"border" : "solid 1px #666",
			"border-top" : "none"
		});
		
		
		$('#thumb_2').css({
			"margin-top" : "10px",
			"height" : "auto"
		});
		$('#thumb_2 h2' ).addClass('thumb_noimage');
		$('#thumb_2 h2' ).css({
			"margin-bottom" : "5px"
		});
		$('#thumb_2 p' ).css({
			"color" : "#444"
		});	
		$('#thumb_2 p first').css({
			'padding-top' : '0'
		});
		$('#thumb_2 p').removeClass("transp_back");
		$('#thumb_3').css({
			"padding": "0px"
		});
		
		
		$("#thumb_new2012").css({
		  "height":"125"
		});
		
		$("#scroller_blue").css("background-color", "#0090E0");
		
		$('#thumb_1').css("height", "120px");
				$("#scroller_yellow").css({
			'height': '167px',
			'margin-top' :  '0px'
			
		});
		
		/*$("#scroller_navbar_yellow").css({
			"top" : "142px"
		});*/
		
		$('#fb_temp h2').addClass('thumb_noimage');
		$('#fb_temp').css('background-color' , 'white');
		$('#fb').css('display' , 'none');
    
    
    $("#steg-1-popup-contents a").live("mousedown", function(){
      $(this).addClass("click");
    });
		$("#steg-1-popup-contents a").live("mouseup", function(){
      $(this).removeClass("click");
    });
		
	}

	
function scrollmaker(name, direction, element) {
		
		//var scroller = new Object;
		this.name = name;
		this.positions = 6;
		this.delay = 5; //delay in seconds between panes
		this.real_delay = this.delay*1000;
		this.height = 145; //distance between sprites
		this.next_pane = 2;
		this.prev = 0;
		this.fade = false;
		this.margin = 0;
		if (element === undefined)
			this.element = "scrollimg"
		else
			this.element = element;
		
		if (direction === undefined)
			this.direction = "top"
		else
			this.direction = direction;

		
		this.setDelay = function(delay) {
			
			this.delay = delay; 
			this.real_delay = this.delay*1000;
			
		}
		
		this.links = new Array();
		
		this.vertiscroll = function(pos) {
			
			if (this.fade == false) {
				if (this.direction == "top")
					$("#"+this.element).animate({top : -(pos-1)*this.height-this.margin});
				else if (this.direction == "left")
					$("#"+this.element).animate({left: -(pos-1)*this.height-this.margin});
			} else {
				var self = this;
				
				$("#"+this.element).fadeOut('fast', function() {
					if (self.direction == "top") {
						$("#"+self.element).animate({top : -(pos-1)*self.height-self.margin}, 100, function() {
							$("#"+self.element).fadeIn('fast');
						});
					} else if (self.direction == "left") {
						$("#"+self.element).animate({left: -(pos-1)*self.height-self.margin}, 100, function() {
							$("#"+self.element).fadeIn('fast');
						});
					}
				});
				
				
				
			}
		}
		this.advance = function(pos) {
			
			if (pos === undefined) {				
				this.next_pane++;
				this.prev++;
			} else {
					this.next_pane = pos+1;
					this.prev = pos-1;
				
			}
			
			if (this.next_pane == this.positions+1 ){
				this.next_pane = 1; 
			}	
			if (this.prev == this.positions )
				this.prev = 0;
			
		}	
		this.controller = function (inc, newpos) {
			
			if (newpos === undefined)
				newpos = null;
			
			this.vertiscroll(inc);
			var self = this
			this.macrotimer = setTimeout(function(){
				self.controller(self.next_pane);
			}, this.real_delay);
			
			this.advance(inc);
			
		}
		this.nav = function(pos, continuer) {
			
			this.stop();
			
			if (pos == 0)
				pos = this.positions;
			
			if (continuer === undefined)
				continuer = true;			
			
			if (continuer) {				
				this.controller(pos);				
			} else {				
				this.vertiscroll(pos);
				this.advance(pos);				
			}
		}
		this.start = function () {
			var self = this
			this.macrotimer = setTimeout(function(){
				self.controller(self.next_pane);
			}, this.real_delay);
			
		}
		this.stop = function() {
			
			try {
				clearTimeout(this.macrotimer);
			} catch(err) {
				timerErr = this.name+"-macrotimer not yet defined";
			}
			
		}
		this.reset = function() {
			
			this.next_pane = 2;
			this.prev = 0;
			this.nav(1, true);
			
		}
		this.navbar = function(mode) {
			
			switch(mode) {
				case "current":
					if (this.links[this.prev].length) {
					  if (this.links[this.prev].indexOf(".asp") != -1)
					    document.location.href = "/"+this.links[this.prev];
					  else
						  document.location.href = "/page.asp?qid="+this.links[this.prev];		
					}
					break;
				case "prev": 
					this.nav(this.prev, false);
					break;
				case "next":
					this.nav(this.next_pane, false);
					break;
			}
			
		}
		this.overlord = function(delay, pos, height, el) {
			
			if (pos !== undefined)			
				this.positions = pos;			
			if (el !== undefined)
				this.element = el;
			if (height !== undefined)
				this.height = height;
			if (delay !== undefined)
				this.setDelay(delay);
			
			
			//return this;
			this.setMargin();
			this.start();
			//this.status();
			
		}
		
		this.setMargin = function(newmargin) {
			
			if (newmargin !== undefined)
				this.margin = newmargin;
			
			if (this.direction == "top")
				$("#"+this.element).css({top : -this.margin});
			else if (this.direction == "left")
				$("#"+this.element).css({left: -this.margin});
	
		}
		
		this.status = function() {
			
			$("#newsletter .logbox").val(this.prev+" "+this.next_pane+" "+this.macrotimer+" "+this.links[this.prev]);
			var self = this
			setTimeout(function() {
				self.status();
			 }, 33);
			
		}

}
  /*var scrollerBlue = new scrollmaker("scrollerBlue", "top");
  	scrollerBlue.setMargin(0);
  	scrollerBlue.fade = true;
  	scrollerBlue.links = ["kris", "infomoten.asp"];*/
	var scrollerYellow = new scrollmaker("scrollerYellow", "left", "horiscroller");
		scrollerYellow.links = [""];
		scrollerYellow.fade = false;
  
	
	var yhscroller = new scrollmaker("scrollerYh", "left", 'yhscroller');
  yhscroller.height = 256;
  yhscroller.setMargin(0);
		//select thumbs for onmouseover animation
		var animatedThumbs = new Array();
		
			animatedThumbs[0] = "1";
			animatedThumbs[1] = "3";
		//	animatedThumbs[2] = "4";
		
		var timerThumb = new Array();
	
		$("document").ready(function() {
				
				//scrollerBlue.overlord(5,2);
				scrollerYellow.overlord(6,1,0);
				
				
  			yhscroller.overlord(4,2);
  			
  			//$("#yhscroller").live("click",function(){
  			//  document.location.href="/yh";
  			//})
				
				$("#scroller_navbar_yellow").hide();
				
				$("#thumb_1").click(function() {
					document.location.href="/finans.asp";
				});
			
				$("#thumb_1").css("cursor", "pointer");
				
				
		// function scrollerEvents() {
				$("#"+scrollerYellow.element).hover(
					function() {
						scrollerYellow.stop();
					}, function() {
						scrollerYellow.start();
					});
					
				/*$("#"+scrollerBlue.element).hover(
					function() {
						scrollerBlue.stop();
					}, function() {
						scrollerBlue.start();
					});
					
				
				$("#scroller_navbar_blue").hover(
					function() {
						scrollerBlue.stop();
					}, function() {
						scrollerBlue.start();
					});*/
				
				$("#scroller_navbar_yellow").hover(
					function() {
						scrollerYellow.stop();
					}, function() {
						scrollerYellow.start();
					});
					
				$(".scroller_icon").hover(
					 function()
					 {
					  this.src = this.src.replace("_off","_on");
					 }, function()
					 {
					  this.src = this.src.replace("_on","_off");
					 }
				);
				
				//$("#"+scroller.element).click(scroller.navbar('current'));
/* 
			} */
				timerAllThumbs = setTimeout(function() {
					
					$("#thumb_1 p").fadeIn(400);
					$("#thumb_3 p").fadeIn(400);
				}, 250);
				
				
				/*#function animate() {
					$("#thumb_1").mouseover(function() {

						try {
								clearTimeout(timerTTwo);						
							} catch(err) { 
								custErr = "timerTTwo not yet defined\n - carry on";
							}
							$("#thumb_1 p").fadeIn(400);

					});

					$("#thumb_1").mouseout(function() {		

						timerTTwo = setTimeout(function(){
							$("#thumb_1 p").fadeOut(400);
						}, 300);

					});


					//#thumb_3 animate
					$("#thumb_3").mouseover(function() {

						try {
							clearTimeout(timerTThree);						
						} catch(err) { 
							custErr = "timerTThree not yet defined\n - carry on";
						}
						$("#thumb_3 p").fadeIn(400);

					});

					$("#thumb_3").mouseout(function() {		

						timerTThree = setTimeout(function(){
							$("#thumb_3 p").fadeOut(400);
						}, 300);

					});

				} */
				
		});
