﻿  $(document).ready(function(){

    $('.rightColumn h3:nth-child(1)').css({"margin-top":"0px"});
	$(".greyBox").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});

});


// input fields 
$(document).ready(function()
{
    $(".txtField").focus(function(srcc)
    {
        if ($(this).val() == $(this)[0].title)
        {
            
            $(this).val("");
        }
    });
    
    $(".txtField").blur(function()
    {
        if ($(this).val() == "")
        {
            $(this).addClass(".txtField");
            $(this).val($(this)[0].title);
        }
    });
    
         
});

// mouse events for boxes

$(document).ready(function(){
    

    $(".tabs").mouseover(function(){
      $(this).find(".arrow img").animate({ 
        width: "22px",
        height: "24px",
        left: "0px",
        top: "-12px"
      }, 300 ).stop();
      
    });
    $(".tabs").mouseout(function(){
      $(this).find(".arrow img").animate({
        width: "11px",
        height: "11px",
        left: "0px",
        top: "0px"
       
      }, 300 );
    });
  });
  
  //sifr
  
  var akkurat = {  
	src:'/UI/flash/akkurat.swf'
};
if (!$.browser.opera) {
    sIFR.activate(akkurat);
}


sIFR.replace(akkurat, {  
	selector: 'h1',
		css: [
			'.sIFR-root{font-size:3.667em; line-height:1em; font-weight:normal; color:#344f62; leading:-7; }',
			
			],
	
	wmode: 'transparent'  

});


sIFR.replace(akkurat, {  
	selector: 'blockquote',
		css: [
			'.sIFR-root{font-size:2em; font-weight:normal; color:#344f62;line-height:1em; leading:-2;}',
			
			],
	
	wmode: 'transparent'  

});
sIFR.replace(akkurat, {  
	selector: '.greyBox dl dt',
		css: [
			'.sIFR-root{font-size:1.5em; color:#ffffff; line-height:1em;}',
			
			],
	
	wmode: 'transparent'  

});

sIFR.replace(akkurat, {  
	selector: 'h2',
		css: [
			'.sIFR-root{font-size:1.5em; color:#344f62; line-height:1em; }',
			
			],
	
	wmode: 'transparent'  

});
sIFR.replace(akkurat, {
    selector: 'h5.boxHeader a.ajaxLinks',
    css: [
			'.sIFR-root{font-size:1.5em; color:#ffffff; line-height:1em; leading:-2; cursor:pointer; }',

			],

    wmode: 'transparent'

});
var run = false;
function loadTab(id, tabID) 
{ 
    
    
    $(".tabs").each(function (){
        $(this).removeClass('activeBox');
    });
    $(tabID).addClass("activeBox");
    $(".arrow").show();
    if (pageUrl[id].length > 0) 
    {
        $.ajax(
        {
            url: pageUrl[id],
            cache: false,
            success: function(message) {
                $("#preloader").show();
                $(".blueContainer").css("display", "block");
                $("#ajaxContainer").fadeOut("slow", function() {
                    $("#ajaxContainer").empty();
                    $("#ajaxContainer").append(message);
                    $("#preloader").hide();
                    pageTracker._trackPageview('/maskinen/' + pageUrl[id]);
                });
            },
            complete: function() {
                if (!run) {
                    $("#ajaxContainer").slideDown("fast");
                    $("#blockContainer").addClass("blockContainerBorder");
                    run = true;
                }
                else if (run) {
                    $("#ajaxContainer").fadeIn("slow");
                }
            }
        }); 
    }  
}


$(document).ready(function() {

    $(".blueContainer").css("display", "none");
    $("#ajaxContainer").css("display", "none");
    $("#ajaxContainer").hasBeenRun = false;
    $("#preloader").hide();

    var intTab = 1;
    $(".tabs").each(function() {
        this.id = intTab;
        $(this).bind('click', function(e) {
            e.preventDefault();
            if (!$(this).hasClass("activeBox")) {
                loadTab(this.id, $(this));
            }
        })
        intTab++;
    });
});
$(document).ready(function() {


    $('dl.imageWithText dd a').lightBox();


});
$(document).ready(function() {
    $(".tabs").addClass("moveScreen");
    $(".moveScreen").click(function() {
    $.scrollTo('+=10px');
    $(".tabs").removeClass("moveScreen");
    });
});