stickyMenus = false;
useMouseOvers = true;
visLayer = 'none';
layerVis = 'none'
mac = 0;
ie = 0;
ns = 0;
opera = 0;
khtml = 0;

if ((navigator.appVersion.indexOf("Mac") > 0) || (navigator.appVersion.indexOf("PPC") > 0)) mac = 1;
ie = (navigator.appVersion.charAt((navigator.appVersion.indexOf('MSIE')) + 5));
if ((navigator.appName == "Netscape") || (navigator.appName == "Mozilla")) ns = (parseInt(navigator.appVersion));

if (navigator.appName == "Mozilla") ns = (ns + 5);
if (navigator.appName == "Opera") opera = 1;

if ((ie == 0) && (ns == 0) && (opera == 0)) ie = 3;




//
// user variables, modify to whatever you want
//

var picX = -1;                 // where is the X center of the picture? Negative numbers = no moving
var picY = -1;                 // where is the Y center of the picture? Negative numbers = no moving
var fade = true;                // should we fade at all?
var picCurrent = 0;             // which picture in the array should we start with? (0 = first)
var fadingSpeed = 40;           // how fast the transition should be
var fadingSteps = 2;            // how small steps the transition should use
var takeItEasy = 1000;           // how long the picture should be shown, at minimum, in milliseconds. I *strongly* suggest 250 or over as a value!
var cacheAhead = 2;             // how many pictures after the current one should be precached
var cacheBack = 0;              // as above, but before the current one. Set both to 0 to disable precaching
var loopSlideshow = false;	// should slideshows repeat ad infinitum?
var slideshow = true;
var picPath = "/pics/main/";  // where the full-res pictures are located
var thumbPath = "pics/66/";     // where the thumbnails are
var picSrc = new Array(         // this is an ordered list of all pictures we should display
"byggkranar.jpg",
"eldkonst.jpg",
"fyr.jpg",
"hammarby.jpg",
"skyskrapor.jpg");


clicks = 0;


if (!Array.prototype.shuffle) {
    Array.prototype.shuffle = function() {
        // Clone this array.
        var result = this.concat();

        // Swap each element with another randomly selected one.
        for (var i = 0; i < result.length; i++) {
            var j = i;
            while (j == i) {
                j = Math.floor(Math.random() * result.length);
            }
            var contents = result[i];
            result[i]    = result[j];
            result[j]    = contents;
        }

        return result;
    };
}
picSrc = picSrc.shuffle();

function firstPageStart()
{
//startMeUp();
//startSlideShow(0,5000,true);
}



///// fade info stops




function switchImage(imgname, target)
	{
	document.images[imgname].src = target.src;
	}

function switchImageUncached(imgname, target)
	{
	document.images[imgname].src = target;
	}


function showMember(empNum)
{
        if (layerVis != 'none') rawHide(layerVis, false);
        rawHide('memberShadow', true);
        rawHide(empNum + "Layer");
        }




function rawHide(id,show)
{
if (show == false)
        {
        if (ns == 4) document.layers[id].visibility = 'hide'
        else if (ns >= 5) document.getElementById(id).style.visibility = 'hidden'
        else if (ie >= 4) document.all[id].style.visibility = 'hidden';
        }
else
        {
        if (layerVis != 'none') {
                if (ns == 4) document.layers[layerVis].visibility = 'hide'
                else if (ns >= 5) document.getElementById(id).style.visibility = 'hidden'
                else if (ie >= 4) document.all[layerVis].style.visibility = 'hidden';
                }
        if (id != 'memberShadow') layerVis = id;
        if (ns == 4) document.layers[id].visibility = 'show'
        else if (ns >= 5) document.getElementById(id).style.visibility = 'visible'
        else if (ie >= 4) document.all[id].style.visibility = 'visible';
        }
}





function printEmailLink(fornamn, efternamn, doman)
{
document.write('<a href="mailto:');
document.write(fornamn);
if (efternamn) document.write('.'+ efternamn);
if (doman) document.write('@' + doman + '">')
else document.write('@brabrandkonsulter.se">');
document.write(fornamn);
if (efternamn) document.write('.'+ efternamn);
if (doman) document.write('@' + doman + '</a>');
else document.write('@brabrandkonsulter.se</a>');
}




function ghosthide(id,show)
{
if (show == false)
        {
        if ((ns >= 5) != (opera == 1)) document.getElementById(id).style.display = 'none'
        else if (ie >= 4) document.all[id].style.display = 'none';
        }
else
        {
        if ((ns >= 5) || (opera == 1)) document.getElementById(id).style.display = 'block'
        else if (ie >= 4) document.all[id].style.display = 'block';
        }
}



function setBackgroundHeight()
{
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
}



function fixUglyIeLinks()
{
for (a in document.links) document.links[a].onfocus = document.links[a].blur;
}

function noAction()
{
}

function openChild(file,window) {
    childWindow=open(file,window,'scrollbars=yes,resizable=yes,width=614,height=400');
    if (childWindow.opener == null) childWindow.opener = self;
    }

function showCookieInfo()
{
alert ('Enligt lagen om elektronisk kommunikation (SFS 2003:389) ska alla som besöker en webbplats med cookies få information om att webbplatsen innehåller cookies, vad dessa används till och hur de kan undvikas.\nDenna webbplats använder cookies för statistik och analys av hur webbplatsen används.\nOm du inte accepterar användandet av cookies kan du stänga av cookies via din webbläsares säkerhetsinställningar.');
}



if (ie >= 4)
{
document.onmousedown = fixUglyIeLinks;
}
