/* 
function openPop(whatUrl,theWidth,theHeight,whatImage,whatTitle){
	xPop		= screen.availWidth/2-(theWidth/2)
	yPop		= screen.availHeight/2-(theHeight/2)
	if(whatUrl!="")oppnawin	= window.open(whatUrl,"pop", "width=" + theWidth + ",height=" + theHeight + ",left="+xPop+",top="+yPop+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")
	if(whatImage){
		oppnawin	= window.open("","pop", "width=" + theWidth + ",height=" + theHeight + ",left="+xPop+",top="+yPop+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")
		oppnawin.document.write("<html>")
		oppnawin.document.write("<head>")
		oppnawin.document.write("<title>"+whatTitle+"</title>")
		oppnawin.document.write("</head>")	
		oppnawin.document.write("<body bgcolor='#fff' marginwidth='0' marginheight='0' topmargin='0' leftmargin='0' margins='0'>");
		oppnawin.document.write("<img src='"+whatImage+"' border='0'>");
		oppnawin.document.write("</body>")
		oppnawin.document.write("</html>")
	}
}


The Visibility Toggle
Copyright 2003 by Sim D'Hertefelt 
www.interactionarchitect.com 
info@interactionarchitect.com
obs id, class och name måste alla användas för IE
måste också initieras i <body>

var hotspots = document.getElementsByName('hotspot');
var toggles = document.getElementsByName('toggle');

function visibilitytoggle()
{
  for (var i = 0; i < hotspots.length; i++)
  {
  hotspots[i].someProperty = i;
  hotspots[i].onclick = function() {toggle(this.someProperty)};
  }

  for (var i = 0; i < toggles.length; i++)
  {
  toggles[i].style.display = 'none';
  }
}

function toggle(i)
{
  if (toggles[i].style.display == 'none')
  {toggles[i].style.display = ''
  }
  else
  toggles[i].style.display = 'none'
} 

function showall()
{
  for (var i = 0; i < toggles.length; i++)
  {
  toggles[i].style.display = '';
  }
}

function hideall()
{
  for (var i = 0; i < toggles.length; i++)
  {
  toggles[i].style.display = 'none';
  }
}

*/
//funktion för CSS bug i IE för onhovermeny finns i UNDANTAG I HEADER

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;


function small_window(myurl) {
var newWindow;
var props = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=200,left = 200,top = 80';
//xtrapiss för IEbugg
if (document.all&&document.getElementById) {
	var myurl = "../" + myurl
}//slut IEpiss
newWindow = window.open(myurl, "Add_from_Src_to_Dest", props);
}


function pop_level2(myurl) {
var pop2;
var props2 = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=200,left = 200,top = 80';
	if (document.all&&document.getElementById) {
		myurl = "../../" + myurl
	}
pop2 = window.open(myurl, "Add_from_Src_to_Dest", props2);
}

function pop_level3(myurl) {
var pop3;
var props3 = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=200,left = 200,top = 80';
	if (document.all&&document.getElementById) {
		myurl = "../../../" + myurl
	}
pop3 = window.open(myurl, "Add_from_Src_to_Dest", props3);
}



function small_window2(myurl) {
var newWindow2;
var props_2 = 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,width=400,height=400,left = 20%,top = 80';
//xtrapiss för IEbugg
if (document.all&&document.getElementById) {
	var myurl = "../" + myurl
}//slut IEpiss
newWindow2 = window.open(myurl, "", props_2);
}


function small_window3(myurl) {
var newWindow3;
var props_3 = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=150,left = 200,top = 80';
var props_3
	if (document.all&&document.getElementById) {
		myurl = "../../" + myurl
	}
newWindow3 = window.open(myurl, "Add_from_Src_to_Dest", props_3);
}


function preview_window(myurl) {
var newWindow4;
var props4 = 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=840,height=600,left = 200,top = 80';
var props4
	if (document.all&&document.getElementById) {
		myurl = "../../" + myurl
	}
newWindow4 = window.open(myurl, "Add_from_Src_to_Dest", props4);
}


function small_windowB(myurl) {
var newWindow2;
var props2 = 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=760,left = 20%,top = 0';
//xtrapiss för IEbugg
if (document.all&&document.getElementById) {
	var myurl = "../" + myurl
}//slut IEpiss
newWindow2 = window.open(myurl, "", props2);
}


function closeRefresh() {  
    opener.top.close();
    window.location.reload();
}






/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Travis Beckham :: http://www.squidfingers.com | http://www.podlob.com
version date: 06/02/03 :: If want to use this code, feel free to do so,
but please leave this message intact. (Travis Beckham) */

// Node Functions i expandmenyn som stänger alla andra undermenyer 
//OBS påverkas av andra listor och javascriptt för dessa för IE OBS OBS oBS


/*

if(!window.Node){
  var Node = {ELEMENT_NODE : 1, TEXT_NODE : 3};
}

function checkNode(node, filter){
  return (filter == null || node.nodeType == Node[filter] || node.nodeName.toUpperCase() == filter.toUpperCase());
}

function getChildren(node, filter){
  var result = new Array();
  var children = node.childNodes;
  for(var i = 0; i < children.length; i++){
    if(checkNode(children[i], filter)) result[result.length] = children[i];
  }
  return result;
}

function getChildrenByElement(node){
  return getChildren(node, "ELEMENT_NODE");
}

function getFirstChild(node, filter){
  var child;
  var children = node.childNodes;
  for(var i = 0; i < children.length; i++){
    child = children[i];
    if(checkNode(child, filter)) return child;
  }
  return null;
}

function getFirstChildByText(node){
  return getFirstChild(node, "TEXT_NODE");
}

function getNextSibling(node, filter){
  for(var sibling = node.nextSibling; sibling != null; sibling = sibling.nextSibling){
    if(checkNode(sibling, filter)) return sibling;
  }
  return null;
}
function getNextSiblingByElement(node){
        return getNextSibling(node, "ELEMENT_NODE");
}

// Menu Functions & Properties

var activeMenu = null;

function showMenu() {
  if(activeMenu){
    activeMenu.className = "";
    getNextSiblingByElement(activeMenu).style.display = "none";
  }
  if(this == activeMenu){
    activeMenu = null;
  } else {
    this.className = "active";
    getNextSiblingByElement(this).style.display = "block";
    activeMenu = this;
  }
  return false;
}

function initMenu(){
  var menus, xmenu, text, a, i;
  menus = getChildrenByElement(document.getElementById("xmenu"));
  for(i = 0; i < menus.length; i++){
    xmenu = menus[i];
    text = getFirstChildByText(xmenu);
    a = document.createElement("a");
    xmenu.replaceChild(a, text);
    a.appendChild(text);
    a.href = "#";
    a.onclick = showMenu;
    a.onfocus = function(){this.blur()};
  }
}

if(document.createElement) window.onload = initMenu;




//slut på butiksmeny





/*cookiemenyn
expanderar och behåller undermenyer öppna med cookies oavsett sida*/
/*
var temp, temp2, cookieArray, cookieArray2, cookieCount;

function initiate(){

  cookieCount=0;

  if(document.cookie){

    cookieArray=document.cookie.split(";");
    cookieArray2=new Array();

    for(i in cookieArray){
      cookieArray2[cookieArray[i].split("=")[0].replace(/ /g,"")]=cookieArray[i].split("=")[1].replace(/ /g,"");
    }

  }

  cookieArray=(document.cookie.indexOf("state=")>=0)?cookieArray2["state"].split(","):new Array();
  temp=document.getElementById("contextmenu");

  for(var o=0;o<temp.getElementsByTagName("li").length;o++){

    if(temp.getElementsByTagName("li")[o].getElementsByTagName("ul").length>0){

      temp2				= document.createElement("span");
      temp2.className			= "clicker";
      temp2.style.backgroundImage	= (cookieArray.length>0)?((cookieArray[cookieCount]=="true")?"url(../img/minus.png)":"url(../img/plus.png)"):"url(../img/plus.png)";
      temp2.onclick=function(){
        showhide(this.parentNode);
        writeCookie();
      }

      for(var p=0;p<temp.getElementsByTagName("li")[o].childNodes.length;p++){

        if(temp.getElementsByTagName("li")[o].childNodes[p].nodeName=="#text"){
          temp2.appendChild(temp.getElementsByTagName("li")[o].childNodes[p]);
        }
      }

      temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild)
      temp.getElementsByTagName("li")[o].getElementsByTagName("ul")[0].style.display = "none";

      if(cookieArray[cookieCount]=="true"){
        showhide(temp.getElementsByTagName("li")[o]);
      }
      cookieCount++;
    }
    else{
      temp2				= document.createElement("span");
      temp2.className			= "symbols";
      temp2.style.backgroundImage	= "url(../img/page.png)";
      temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild);
    }
  }
  
}



function showhide(el){
  el.getElementsByTagName("ul")[0].style.display=(el.getElementsByTagName("ul")[0].style.display=="block")?"none":"block";
  el.getElementsByTagName("span")[0].style.backgroundImage=(el.getElementsByTagName("ul")[0].style.display=="block")?"url(../img/minus.png)":"url(../img/plus.png)";
}



function writeCookie(){		// Runs through the menu and puts the "states" of each nested list into an array, the array is then joined together and assigned to a cookie.
  cookieArray=new Array()
  for(var q=0;q<temp.getElementsByTagName("li").length;q++){

    if(temp.getElementsByTagName("li")[q].childNodes.length>0){
      if(temp.getElementsByTagName("li")[q].childNodes[0].nodeName.toLowerCase()=="span" && temp.getElementsByTagName("li")[q].getElementsByTagName("ul").length>0){

        cookieArray[cookieArray.length]=(temp.getElementsByTagName("li")[q].getElementsByTagName("ul")[0].style.display=="block");
      }
    }
  }
  document.cookie="state="+cookieArray.join(",")+";expires="+new Date(new Date().getTime() + 365*24*60*60*1000).toGMTString();
}
*/
