

var StrProtocol = window.location.protocol
var domain = window.location.hostname
var url = StrProtocol + "//" + domain


   var http_request = false;
   function makeRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request.onreadystatechange = alertContents;
      http_request.open('GET', url + parameters, true);
      http_request.send(null);

      /*sikre at læg i kurv virker selv om scriptet med vis DIV fejler */
      try {
      display_confirmAddToBasket()
       }
      catch (err) { 
      }

   }

   function alertContents() {
      if (http_request.readyState == 4) {
//         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('varekurv').innerHTML = result;            
/*         } else {
            alert('There was a problem with the request.');
         }*/
      }
   }

   function get(obj) {
       var getstr = "&";
       for (i = 0; i < obj.getElementsByTagName("input").length; i++) {
           if (obj.getElementsByTagName("input")[i].type == "text") {
               getstr += obj.getElementsByTagName("input")[i].name + "=" +
                   obj.getElementsByTagName("input")[i].value + "&";
           }
           if (obj.getElementsByTagName("input")[i].type == "hidden") {
               getstr += obj.getElementsByTagName("input")[i].name + "=" +
                   obj.getElementsByTagName("input")[i].value + "&";
           }
           if (obj.getElementsByTagName("input")[i].type == "checkbox") {
               if (obj.getElementsByTagName("input")[i].checked) {
                   getstr += obj.getElementsByTagName("input")[i].name + "=" +
                   obj.getElementsByTagName("input")[i].value + "&";
               } else {
                   getstr += obj.getElementsByTagName("input")[i].name + "=&";
               }
           }
           if (obj.getElementsByTagName("input")[i].type == "radio") {
               if (obj.getElementsByTagName("input")[i].checked) {
                   getstr += obj.getElementsByTagName("input")[i].name + "=" +
                   obj.getElementsByTagName("input")[i].value + "&";
               }
           }
           if (obj.getElementsByTagName("input")[i].tagName == "SELECT") {
               var sel = obj.getElementsByTagName("input")[i];
               getstr += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";
           }
       }

       getstr = '?front=1' + getstr
       //alert(getstr)
       makeRequest('shoppingcart.asp', getstr);
      // makeRequest('include/TopKurv.asp', getstr);
   }


function strpos(str, ch) {
for (var i = 0; i < str.length; i++)
if (str.substring(i, i+1) == ch) return i;
return -1;
}



// Popup window opened in the middle of the browser window
function popup_window(url, windowName, w, h) {
	newwindow = window.open(url, windowName, 'top='+((screen.height - h) / 2)+', left='+((screen.width - w) / 2)+', toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h)
	newwindow.focus();
	return newwindow;
}

// Popup window correct size 
function popup_info(url, nowrap) {
	if(nowrap == '0' || nowrap == 0) {
		var nowrap_str = '';
	} else {
		var nowrap_str = '?nowrap=1';
	}
	popup_window(url + nowrap_str, 'InfoCenter', 615, 520);
}

// Get body element depending on browser version
function browser_body() {
	if(navigator.appName == 'Opera') {
		return document.body;
	} else {
		return (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
	}
}

var seconds = 10

function CountDown() {
    if (seconds <= -1) {
        seconds = 0
    }else{
        seconds -= 1
        document.getElementById('counter').value = seconds + " sek"
   }
}

//
// Show/hide DIV after adding products in the basket
//
var basketConfirmTimer = 0;
var CountDownInterval = 0

function display_cursor() {
	// Alias for display_confirmAddToBasket()
	display_confirmAddToBasket();
}
function display_confirmAddToBasket() {
	cookie = getCookie('Toplevel_HideBasketConfirm');
	if(cookie == '1') {
		return false;
	}
	clearTimeout(basketConfirmTimer);
	clearInterval(CountDownInterval)
	object = document.getElementById('Toplevel_ConfirmAddToBasket');
	if(object) {
		width = 570;
		height = 256;
		elem = browser_body();
		object.style.width = width + 'px';
		object.style.height = height + 'px';
		object.style.top = (elem.scrollTop + (elem.clientHeight-height)/2) + 'px';
		object.style.left = ((elem.clientWidth-width)/2) + 'px';
		object.style.display = 'block';
		object.style.visibility = 'visible';
		basketConfirmTimer = setTimeout("hide_confirmAddToBasket();", 10000);
		seconds = 10
		CountDownInterval = setInterval("CountDown();", 1000);

    }
}

function hide_confirmAddToBasket() {
	object = document.getElementById('Toplevel_ConfirmAddToBasket');
	cookie = getCookie('Toplevel_HideBasketConfirm');
	if(object) {
		object.style.display = 'none';
		object.style.visibility = 'hidden';
	}
	clearTimeout(basketConfirmTimer);
	clearInterval(CountDownInterval)
}
function state_nomore() {
    setCookie('Toplevel_HideBasketConfirm', '1', 7);
    hide_confirmAddToBasket()
}

// Preload confirmation box background
_i = new Image(570, 256)
_i.src = '/img_label/varelagtikurvdivbg.gif';


// Make a AJAX-call to arg url. Arg handler must be a function
// that takes exactly one (1) argument = ajax request object
function AjaxCall(url, handler) {
	var GetXmlHttpObject = function() {
		var xmlHttp = null;
		try {
			xmlHttp = new XMLHttpRequest();
		} catch (e) {
			try {
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		return xmlHttp;
	}
	xmlHttp = GetXmlHttpObject();
	xmlHttp.onreadystatechange = function() {
		handler(xmlHttp);
	}
	xmlHttp.open('GET', url, true);
	xmlHttp.send(null);
}


// ---------------------------------------
//  COOKIES
// ---------------------------------------


function setCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
    setCookie(name, "", -1);
}

/*
HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - 

    Man kan ikke bruge GloIntCid, men Request.Querystring("c") 
    Det RIGTIGE C-id kommer fra komponenten sat på script_lib.asp?C=" & GloIntCID 
    
HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - HUSK - OBS - 
*/

// FLASHOBJECT

/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */

if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;


// FLASHOBJECT END

//EXPAND OR COLLAPSE ID
function expandcollapse(id) {
	var e = document.getElementById(id);
	if(e.style.display == 'none')
		e.style.display = 'block';
	else
		e.style.display = 'none';
}

//POP WINDOW
function R(theURL,winName,features)
	{ 
	win = window.open(theURL,winName,features); 
	}



//------------------------ DROPDOWN MENU START ------------------------

document.write('<div id="topmenudropdiv" onMouseover="clearhidemenu();" onMouseout="delayhidemenu()"></div>')

function showhidemenu(obj, e, visible, hidden, menuwidth){
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){dropmenuobj.style.width=menuwidth}
if (e.type=="mouseover")
obj.visibility=visible
}


function dropdownmenu(obj, e, menucontents, menuwidth, xoffset, menutype){
if (document.flashobject){
	document.flashobject.style.visibility = "hidden"
}
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById("topmenudropdiv")
obj.className='topmenutdsel'
topmenuobj = obj
if (menutype == 'arr')
dropmenuobj.innerHTML=menucontents.join("")
else
dropmenuobj.innerHTML=menucontents
showhidemenu(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+xoffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
//Hide iframes (shop-map on shops.asp page etc.)
iframemapobj=document.getElementById("iframemapdiv")
if (iframemapobj){iframemapobj.style.visibility = "hidden"}
//Hide shoppingcart cell
elementsccellobj=document.getElementById("shoppingcartcell")
if (elementsccellobj){elementsccellobj.style.visibility = "hidden"}
//Hide flashobject 
flaobjectobj=document.getElementById("swf_campaign")
if (flaobjectobj){flaobjectobj.style.visibility = "hidden"}
//Hide dropbox 
dropboxobj=document.getElementById("dropboxStores")
if (dropboxobj){dropboxobj.style.visibility = "hidden"}
}

function hidemenu(){
if (document.flashobject){
	document.flashobject.style.visibility = "visible"
}
if (typeof dropmenuobj!="undefined"){
dropmenuobj.style.visibility="hidden"
topmenuobj.className='topmenutd'
//Show shop-map in iframe on shops.asp page
if (iframemapobj){iframemapobj.style.visibility = "visible"}
//Show shoppingcart cell
if (elementsccellobj){elementsccellobj.style.visibility = "visible"}
//Show flashobject
if (flaobjectobj){flaobjectobj.style.visibility = "visible"}
//Hide dropbox 
if (dropboxobj){dropboxobj.style.visibility = "visible"}
}
}
function delayhidemenu(){
delayhide=setTimeout("hidemenu()",200)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

//------------------------ DROPDOWN MENU END ------------------------



//------------------------ FITS LIST START ------------------------

    document.write('<div id="fitslistdiv" onMouseover="clearhidefitslist();" onMouseout="delayhidefitslist()"><p align=right><img src="img/icon_close.gif" OnClick="hidefitslist()" style="cursor: hand; cursor: pointer;"></p></div>')


function showhidefitslist(obj, e, visible, hidden){
fitslistobj.style.left=fitslistobj.style.top=-500
//if (e.type=="mouseover")
obj.visibility=visible
}

var xmlhttp;
var Loadxmlhttp
var Load1xmlhttp
var Load2xmlhttp
var Load3xmlhttp
var xmlobj;
var xmltarget;
var xmlurl;

function loadFitlist(pnid,target) {

	xmlpnid = pnid;
	xmltarget = target;

	if (window.XMLHttpRequest) {
		xmlhttp=new XMLHttpRequest()
		xmlhttp.onreadystatechange = xmlFitlist;
		xmlhttp.open("GET",url + "/passertil.asp?c=975877754&n=1226003481&pn="+xmlpnid,true)
		xmlhttp.send(null)
	} else if (window.ActiveXObject) {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		if (xmlhttp) {
			xmlhttp.onreadystatechange=xmlFitlist
				xmlhttp.open("GET",url + "/passertil.asp?c=975877754&n=1226003481&pn="+xmlpnid,true)
			xmlhttp.send()
		}
	}
}
		
function xmlFitlist() {
	if (xmlhttp.readyState == 4) {
		if (xmlhttp.status == 200) {
//alert('xmlFitlist')
			document.getElementById(xmltarget).innerHTML = xmlhttp.responseText;
		} else {
//			alert("Problem retrieving XML data - xmlFitlist")
		//	alert(xmlhttp.responseText);
		}
	}
}

function IsNumeric(strString)
{
var strValidChars = "0123456789.-";
var strChar;
var blnResult = true;

if (strString.length == 0) return false;

//  test strString consists of valid characters listed above
for (i = 0; i < strString.length && blnResult == true; i++)
  {
  strChar = strString.charAt(i);
  if (strValidChars.indexOf(strChar) == -1)
	 {
	 blnResult = false;
	 }
  }
return blnResult;
}
   
function fitslist(obj, e, content, xoffset){
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	clearhidefitslist()

	fitslistobj=document.getElementById("fitslistdiv")
	
	if ( IsNumeric(content) ){
		fitslistobj.innerHTML="";
		loadFitlist(content,"fitslistdiv");
	} else {
		fitslistobj.innerHTML=content;
	}
	
	showhidefitslist(fitslistobj.style, e, "visible", "hidden")
	fitslistobj.x=getposOffset(obj, "left")
	fitslistobj.y=getposOffset(obj, "top")
	fitslistobj.style.left=fitslistobj.x-clearbrowseredge(obj, "rightedge")+xoffset+"px"
	fitslistobj.style.top=fitslistobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

function hidefitslist(){
if (typeof fitslistobj!="undefined"){fitslistobj.style.visibility="hidden"}
}

function delayhidefitslist(){
delayhide=setTimeout("hidefitslist()",200)
}

function clearhidefitslist(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

//------------------------ FITS LIST END ------------------------



//--------------------- GLOBAL LAYER FUNCTIONS ----------------------
//til menu og fits start

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : 

totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : 
document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=!window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : 

window.pageXOffset+window.innerWidth-15
obj.contentmeasure=obj.offsetWidth
if (windowedge-obj.x < obj.contentmeasure)
edgeoffset=obj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=!window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : 

window.pageYOffset+window.innerHeight-18
obj.contentmeasure=obj.offsetHeight
if (windowedge-obj.y < obj.contentmeasure)
edgeoffset=obj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

// slut

function sumtruebody(){
sumresult = (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body;
//if the user has scrolled - then take layer down 20px
if (sumresult > 0){sumresult = sumresult + 20};
return (sumresult)
}


//------------------------ SHOW IMG-LAYER START ------------------------

document.write('<div id="imglayerdiv"></div>')

function showimglayerdiv(imgfile, e, imgwidth, imgheight){
elementobj=document.getElementById("imglayerdiv")

//Hide xs-map in iframe
//elementmapxsobj=document.getElementById("mapxsdiv")
//if (elementmapxsobj){elementmapxsobj.style.visibility = "hidden"}

//Hide shoppingcart cell
elementsccellobj=document.getElementById("shoppingcartcell")
if (elementsccellobj){elementsccellobj.style.visibility = "hidden"}

realimgwidth = imgwidth
realimgheight = imgheight

//add 10px border and close button to sizes
imgwidth = (imgwidth+20)
imgheight = (imgheight+40)

pgyoffset = parseInt(sumtruebody().scrollTop)

//if the user has scrolled - then take layer down 20px
if (pgyoffset > 0){pgyoffset = pgyoffset + 20}

scrx = sumtruebody().scrollLeft+sumtruebody().clientWidth
scry = sumtruebody().clientHeight

//if (window.opera && window.innerHeight) //compensate for Opera toolbar
//scry = pgyoffset+window.innerHeight

horzpos = scrx/2-imgwidth/2
vertpos = scry/2-imgheight/2

vertpos = Math.max(pgyoffset, vertpos)

if ((imgwidth > Math.round(scrx/1.2)) || (imgheight > Math.round(scry/1.2)))
{
//recalc. posistions
if (imgwidth > Math.round(scrx/1.2)){imgwidth = Math.round(scrx/1.2)}
//if (imgheight > Math.round(scry/1.2)){imgheight = Math.round(scry/1.2); imgwidth = imgwidth+25;}

horzpos = scrx/2-imgwidth/2
vertpos = scry/2-imgheight/2

vertpos = Math.max(pgyoffset, vertpos)

//lift 5px up from statusbar
vertpos = vertpos - 5
HTMLtxt = '<table id="imglayertable"><tr><td id="imglayertablecell"><p align="right"><img src="img/icon_closewindow.gif" OnClick="hideimglayerdiv(\'imglayerdiv\');" style="cursor: hand; cursor: pointer;"></p><iframe src="'+imgfile+'" width='+imgwidth+' height='+imgheight+' frameborder="no" border=0 marginwidth=0 marginheight=0 scrolling="auto"></iframe></td></tr></table>'
}
else{
HTMLtxt = '<table id="imglayertable"><tr><td id="imglayertablecell"><p align="right"><img src="img/icon_closewindow.gif" OnClick="hideimglayerdiv(\'imglayerdiv\');" style="cursor: hand; cursor: pointer;"></p><img src="'+imgfile+'" width='+realimgwidth+' height='+realimgheight+'></td></tr></table>'
}

//Move down so the topbar is allways visible
if (vertpos < 126){
vertpos = 127

}
elementobj.style.left = Math.round(horzpos)+"px"
elementobj.style.top = Math.round(vertpos)+"px"

elementobj.innerHTML = HTMLtxt
elementobj.style.visibility = "visible"
}

function hideimglayerdiv(DivToHide){

    if (DivToHide != "") {
        document.getElementById(DivToHide).style.visibility="hidden"
    }else{
        elementobj.style.visibility="hidden"
    }
//Show xs-map in iframe
//if (elementmapxsobj){elementmapxsobj.style.visibility = "visible"}

//Show shoppingcart cell
if (elementsccellobj){elementsccellobj.style.visibility = "visible"}
}

//------------------------ SHOW IMG-LAYER END ------------------------


//------------------------ SHOW xLAYER START ------------------------

function showxlayer(whichelement, e, position, imgwidth, imgheight){

elementobj = document.getElementById(''+whichelement+'')

if (position=="center"){
pgyoffset = parseInt(sumtruebody().scrollTop)
horzpos = sumtruebody().scrollLeft+sumtruebody().clientWidth/2-imgwidth/2
vertpos = pgyoffset+sumtruebody().clientHeight/2-imgheight/2
if (window.opera && window.innerHeight) //compensate for Opera toolbar
vertpos=pgyoffset+window.innerHeight/2-imgheight/2
vertpos=Math.max(pgyoffset, vertpos)
}
else{
var horzpos = sumtruebody().scrollLeft+event.clientX
var vertpos = sumtruebody().scrollTop+event.clientY
}
if (vertpos < 100){vertpos = 100} //compose for topmenu
elementobj.style.left=horzpos+"px"
elementobj.style.top=vertpos+"px"
//elementobj.innerHTML='<img src="'+which+'" onClick="hidexlayer()">'
elementobj.style.visibility="visible"
}

function hidexlayerdiv(){
elementobj.style.visibility="hidden"
}

//------------------------ SHOW xLAYER END ------------------------


//------------------------ SHOW IFRAMELAYER START ------------------------

document.write('<div id="iframelayerdiv"></div>')
document.write('<div id="iframelayerWheelGuidediv"></div>')

function showiframelayer(whichelement, e, pagefile, position, width, height){
    if (document.flashobject){
	    document.flashobject.style.visibility = "hidden"
    }

    elementobj = document.getElementById(''+whichelement+'')

    //Hide xs-map in iframe
    //elementmapxsobj=document.getElementById("mapxsdiv")
    //if (elementmapxsobj){elementmapxsobj.style.visibility = "hidden"}

    //Hide shoppingcart cell
    elementsccellobj=document.getElementById("shoppingcartcell")
    if (elementsccellobj){elementsccellobj.style.visibility = "hidden"}

    //Hide partsearch selects
    elementspsselectsobj=document.getElementById("psselects")
    if (elementspsselectsobj){psselects.style.visibility = "hidden"}

    realwidth = width
    realheight = height

    if (position=="center"){
        //add 10px border and close button to sizes
        width = (width+20)
        height = (height+40)

        pgyoffset = parseInt(sumtruebody().scrollTop)

        //if the user has scrolled - then take layer down 20px
        if (pgyoffset > 0){pgyoffset = pgyoffset + 20}

        scrx = sumtruebody().scrollLeft+sumtruebody().clientWidth
        scry = sumtruebody().clientHeight

        //if (window.opera && window.innerHeight) //compensate for Opera toolbar
        //scry = pgyoffset+window.innerHeight

        horzpos = scrx/2-width/2
        vertpos = scry/2-height/2

        vertpos = Math.max(pgyoffset, vertpos)

        if ((width > Math.round(scrx/1.2)) || (height > Math.round(scry/1.2)))
        {
            //recalc. posistions
            if (width > Math.round(scrx/1.2)){width = Math.round(scrx/1.2)}
            if (height > Math.round(scry/1.2)){height = Math.round(scry/1.2); width = width+25;}

            horzpos = scrx/2-width/2
            vertpos = scry/2-height/2

            vertpos = Math.max(pgyoffset, vertpos)

            //lift 5px up from statusbar
            vertpos = vertpos - 5
        }
    
    }else{
        var horzpos = sumtruebody().scrollLeft+event.clientX
        var vertpos = sumtruebody().scrollTop+event.clientY
    }
    
    //Move down so the topbar is allways visible
    if (vertpos < 126){vertpos = 127} //compose for topmenu

    if (position=="center"){
        vertpos = 110
    }

    elementobj.style.left=Math.round(horzpos)+"px"
    elementobj.style.top=Math.round(vertpos)+"px"
    if (whichelement == "iframelayerWheelGuidediv"){   
        elementobj.innerHTML= '<table id="iframelayertable"><tr><td id="iframelayerWheelGuidetablecell"><p align="right" id="iframelayerp"><img src="img/icon_print_black.gif" onclick="printIframe(\'WheelGuideiFrame\')" /> &nbsp&nbsp&nbsp <img src="img/icon_closewindow.gif" OnClick="hideiframelayerdiv(\'' + whichelement + '\');" style="cursor: hand; cursor: pointer;"></p><iframe id="WheelGuideiFrame" src="'+url+"/"+pagefile+'" width='+realwidth+' height='+realheight+' frameborder="no" border=0 marginwidth=0 marginheight=0 scrolling="auto"></iframe></td></tr></table>'
    }else{
        elementobj.innerHTML= '<table id="iframelayertable"><tr><td id="iframelayertablecell"><p align="right" id="iframelayerp"><img src="img/icon_closewindow.gif" OnClick="hideiframelayerdiv(\'' + whichelement + '\');" style="cursor: hand; cursor: pointer;"></p><iframe src="'+url+"/"+pagefile+'" width='+realwidth+' height='+realheight+' frameborder="no" border=0 marginwidth=0 marginheight=0 scrolling="auto"></iframe></td></tr></table>'
    }
    elementobj.style.visibility="visible";
    scroll(0,100);
}


function hideiframelayerdiv(DivToHide){

    if (document.flashobject){
	    document.flashobject.style.visibility = "visible"
    }
    if (DivToHide != "") {
        document.getElementById(DivToHide).style.visibility="hidden"
    }else{
        elementobj.style.visibility="hidden"
    }

    
    //Show xs-map in iframe
    //if (elementmapxsobj){elementmapxsobj.style.visibility = "visible"}
    //Show shoppingcart cell
    if (elementsccellobj){elementsccellobj.style.visibility = "visible"}
    //Show partsearch selects
    if (elementspsselectsobj){elementspsselectsobj.style.visibility = "visible"}
}

//------------------------ SHOW IFRAMELAYER END ------------------------


//------------------------ SHOW PAPERLAYER START ------------------------
function ChangePage(obj, PageFileName, InitPage){
if (!prevpageobj){
prevpageobj = document.getElementById('pageobject'+InitPage);
}
if (prevpageobj){
prevpageobj.style.background='#BBEFFF';
}
paperframe.location = PageFileName;
obj.style.background='#9BCFF3';
prevpageobj = obj;	
}


document.write('<div id="paperlayerdiv"></div>')

function showpaperlayer(e, pagefile, position, totalpages, currentpage, path){

prevpageobj = null;
var pagesstr = '';

for (i = 1; i <= totalpages; i++)
{
if (i == currentpage){
pagesstr = pagesstr + '<td id="pageobject'+i+'" style="font: 10px Verdana, Arial; color: #355296; font-weight: bold; width: 20px; height: 20px; padding: 2px 2px 2px 2px; text-align: center; background: #9BCFF3; border: 1px solid #355296; cursor: hand; cursor: pointer;" OnClick="ChangePage(this, \'http:\/\/media.thg.dk\/DAT\/press\/Avis\/'+path+'\/avis-'+i+'.jpg\', '+currentpage+')";>'+i+'</td>'
}else
{
pagesstr = pagesstr + '<td id="pageopject'+i+'" style="font: 10px Verdana, Arial; color: #355296; font-weight: bold; width: 20px; height: 20px; padding: 2px 2px 2px 2px; text-align: center; background: #FFFFFF; border: 1px solid #355296; cursor: hand; cursor: pointer;" OnClick="ChangePage(this, \'http:\/\/media.thg.dk\/DAT\/press\/Avis\/'+path+'\/avis-'+i+'.jpg\', '+currentpage+')";>'+i+'</td>'
}
}

elementobj = document.getElementById('paperlayerdiv')

//Hide shoppingcart cell
elementsccellobj=document.getElementById("shoppingcartcell")
if (elementsccellobj){elementsccellobj.style.visibility = "hidden"}

width = 825
height = 1100

realwidth = width
realheight = height

if (position=="center"){
//add 10px border and close button to sizes
width = (width+20)
height = (height+40)

scrx = sumtruebody().scrollLeft+sumtruebody().clientWidth

horzpos = scrx/2-width/2

if ( width > Math.round(scrx/1.2) )
{
//recalc. posistions
if (width > Math.round(scrx/1.2)){width = Math.round(scrx/1.2)}
horzpos = scrx/2-width/2
}
}
else{
var horzpos = sumtruebody().scrollLeft+event.clientX
}
//compose for topmenu - 75px
elementobj.style.left=Math.round(horzpos)+"px"
elementobj.style.top="75px"
elementobj.innerHTML= '<table id="paperlayertable"><tr><td id="paperlayertablecell"><p align="right"><img src="img/icon_closewindow.gif" OnClick="hidepaperlayerdiv();" style="cursor: hand; cursor: pointer;"></p><center><table cellspacing=2><tr>'+pagesstr+'</tr></table></center><br><iframe src="'+pagefile+'" width='+realwidth+' height='+realheight+' name="paperframe" frameborder="no" border=0 marginwidth=0 marginheight=0 scrolling="auto"></iframe></td></tr></table>'
elementobj.style.visibility="visible"
}

function hidepaperlayerdiv(){
elementobj.style.visibility="hidden"
//Show shoppingcart cell
if (elementsccellobj){elementsccellobj.style.visibility = "visible"}
}

//------------------------ SHOW IFRAMELAYER END ------------------------

//------------------------ FROM INSTOCKSHOPMAP.asp ---------------------

function showshoptitleFyr(txt, xoffset, yoffset, extrainfo){
elementobj = document.getElementById("shoptitlediv")
//if the position is all at the right then show box to the left
if (xoffset > 120){xoffset = (xoffset-178)}
elementobj.style.left = xoffset+"px"
elementobj.style.top = yoffset+"px"
elementobj.innerHTML = "<nobr>"+txt+"</nobr>"
elementobj.style.visibility = "visible"
if (!extrainfo == ''){showshoptitleinfo(extrainfo, xoffset, (yoffset + 27));}
}

function showshoptitleFyr(txt, xoffset, yoffset, extrainfo, extrainfobgcolor){
elementobj = document.getElementById("shoptitlediv")
//if the position is all at the right then show box to the left
if (xoffset > 20){xoffset = (xoffset-178)}
elementobj.style.left = xoffset+"px"
elementobj.style.top = yoffset+"px"
elementobj.innerHTML = "<nobr>"+txt+"</nobr>"
elementobj.style.visibility = "visible"
if (!extrainfo == ''){showshoptitleinfo(extrainfo, xoffset, (yoffset + 27),extrainfobgcolor);}
}

function showshoptitleXS(txt, xoffset, yoffset, extrainfo, extrainfobgcolor){
elementobj = document.getElementById("shoptitlediv")
//if the position is all at the right then show box to the left
if (xoffset > 78){xoffset = (xoffset-178)}
elementobj.style.left = xoffset+"px"
elementobj.style.top = yoffset+"px"
elementobj.innerHTML = "<nobr>"+txt+"</nobr>"
elementobj.style.visibility = "visible"
if (!extrainfo == ''){showshoptitleinfo(extrainfo, xoffset, (yoffset + 27),extrainfobgcolor);}
}

function showshoptitle(txt, xoffset, yoffset, extrainfo, extrainfobgcolor){
elementobj = document.getElementById("shoptitlediv")
//if the position is all at the right then show box to the left
if (xoffset > 385){xoffset = (xoffset-178)}
elementobj.style.left = xoffset+"px"
elementobj.style.top = yoffset+"px"
elementobj.innerHTML = "<nobr>"+txt+"</nobr>"
elementobj.style.visibility = "visible"
if (!extrainfo == ''){showshoptitleinfo(extrainfo, xoffset, (yoffset + 27), extrainfobgcolor);}
}

function showshoptitleinfo(txt, xoffset, yoffset, bgcolor){
elementobj = document.getElementById("shoptitleinfodiv")
elementobj.style.left = xoffset+"px"
elementobj.style.top = yoffset+"px"
elementobj.innerHTML = "<nobr>"+txt+"</nobr>"
elementobj.style.background = bgcolor
elementobj.style.visibility = "visible"
}

function hideshoptitle(){
elementobj = document.getElementById("shoptitlediv")
elementobj.style.visibility = "hidden"
elementobjex = document.getElementById("shoptitleinfodiv")
if (elementobjex){elementobjex.style.visibility = "hidden"}
}
function hideshoptitle___xs(){
e = document.getElementById("shoptitlediv")
e.style.visibility = "hidden"
eex = document.getElementById("shoptitleinfodiv")
if (eex){eex.style.visibility = "hidden"}
}

function showshopinfo(webid,instocktxt,instocktxtcolor){
elementobj = document.getElementById("shopinfodiv")
elementobj.style.left = "5px"
elementobj.style.top = "75px"
HTMLtxt = '<table id="shopinfotable"><tr><td id="shopinfotablecell"><p align="right"><img src="img/icon_closewindow.gif" onclick="hideshopinfo();" style="cursor: hand; cursor: pointer;"></p><iframe src="shopinfo.asp?c=975877754&webid='+webid+'" width="500" height="300" frameborder="no" border=0 marginwidth=0 marginheight=0 scrolling="auto"></iframe><br><img src=skins//danmark_lagerstatus.gif><br><font color='+instocktxtcolor+'>'+instocktxt+'<br><br></font></td></tr></table>'
elementobj.innerHTML = HTMLtxt
elementobj.style.visibility = "visible"
}
function hideshopinfo(){
	elementobj = document.getElementById("shopinfodiv")
	elementobj.style.visibility = "hidden"
}

function popupWindow(page){
	window.open(page, "windowOpen", "height=" + screen.availHeight + "px,width=" + screen.availWidth + "px,top=0,left=0,location=0,menubar=0,resizable=0,scrollbars=0,toolbar=0,channelmode=yes,fullscreen=yes");
}


var xmlhttp;
var xmltarget;
var xmlurl;

function loadOpeninghours(target) {

//    var Load3xmlhttp
	xmltarget = target;

	if (window.XMLHttpRequest) {
		Load3xmlhttp=new XMLHttpRequest()
		Load3xmlhttp.onreadystatechange = xmlOpeninghours;
		Load3xmlhttp.open("GET",url + "/openinghours.asp?c=975877754",true)
		Load3xmlhttp.send(null)
	} else if (window.ActiveXObject) {
		Load3xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		if (Load3xmlhttp) {
			Load3xmlhttp.onreadystatechange=xmlOpeninghours
				Load3xmlhttp.open("GET",url + "/openinghours.asp?c=975877754",true)
			Load3xmlhttp.send()
		}
	}
}
		
function xmlOpeninghours() {
	if (Load3xmlhttp.readyState == 4) {
		if (Load3xmlhttp.status == 200) {
			
			expandcollapse(xmltarget);
//alert('xmlOpeninghours')			
			document.getElementById(xmltarget).innerHTML = Load3xmlhttp.responseText;
		} else {
//			alert("Problem retrieving XML data - xmlOpeninghours")
		//	alert(Load3xmlhttp.responseText);
		}
	}
}

//Signon to newsletter on the frontpage - Start
    
    var xmlhttp               
    function loadNewsletterSignon(target,action,data) {
        
        if (action == "" || action == null ){
            AddToQuerystring = "&action=form"       
        }else{
            AddToQuerystring = "&action=" + action + "&data=" + data      
        }
            
	    xmltarget = target;

	    if (window.XMLHttpRequest) {
		    xmlhttp=new XMLHttpRequest()
		    xmlhttp.onreadystatechange = xmlNewsletterSignon;
		    xmlhttp.open("GET",url + "/newslettersignon.asp?c=975877754" + AddToQuerystring,true)
		    xmlhttp.send(null)
	    } else if (window.ActiveXObject) {
		    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		    if (xmlhttp) {
			    xmlhttp.onreadystatechange=xmlNewsletterSignon
				    xmlhttp.open("GET",url + "/newslettersignon.asp?c=975877754" + AddToQuerystring,true)
			    xmlhttp.send()
		    }
	    }
    }

    function xmlNewsletterSignon() {
	    if (xmlhttp.readyState == 4) {
		    if (xmlhttp.status == 200) {
			    document.getElementById(xmltarget).style.display = 'block';
			    document.getElementById(xmltarget).innerHTML = xmlhttp.responseText;
		    } else {
			    alert("Problem ved hentning af data - xmlNewsletterSignon")
			   alert(xmlhttp.responseText);
		    }
	    }
    }


//Signon to newsletter on the frontpage - End

//Validate NewsletterSignon
//function SignonValidateEmail(NameFieldToValidate,EMailFieldToValidate,TlfFieldToValidate,action){    
function SignonValidateEmail(EMailFieldToValidate,action){    

    var ValidationErrorText
    ValidationErrorText = "" 
    ValidationErrorFound = false
        
/*    NameToValidate = document.getElementById(NameFieldToValidate).value
    if (NameToValidate == "" || NameToValidate == null || NameToValidate.length < 2 || NameToValidate == "Navn" )  {
       ValidationErrorText = ValidationErrorText + "Indtast venligst dit navn\n"
       ValidationErrorFound = true;
    }*/

    EmailToValidate = document.getElementById(EMailFieldToValidate).value;
    var emailRegxp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    
    if (emailRegxp.test(EmailToValidate) != true){
        ValidationErrorText = ValidationErrorText + "Ugyldig E-mail\n" 
        ValidationErrorFound = true
    } 
    
/*    TlfToValidate = document.getElementById(TlfFieldToValidate).value
    if (TlfToValidate == "" || TlfToValidate == null || TlfToValidate == "Telefon" )  {
       ValidationErrorText = ValidationErrorText + "Indtast venligst dit telefonnummer\n"
       ValidationErrorFound = true
    }else if (TlfToValidate.length != 8 || !isNaN(TlfToValidate) == false){
       ValidationErrorText = ValidationErrorText + "Dit telefonnummer er ikke 8 tal\n"
       ValidationErrorFound = true
    }*/
    
    if (ValidationErrorFound != true){
        //loadNewsletterSignon('newsletterboxdiv','sign'+action,EmailToValidate+'---'+NameToValidate+'---'+TlfToValidate)  
        loadNewsletterSignon('newsletterboxdiv','sign'+action,EmailToValidate)  
    }else{
        alert(ValidationErrorText) 
    }        

}
  
//changes the style for newsletter signup on the frontpage
function InputFocus(obj) {
    document.getElementById(obj).style.color = 'black'
    if (document.getElementById(obj).value == "Navn") {
        document.getElementById(obj).value = ""
    }
    if (document.getElementById(obj).value == "Telefon") {
        document.getElementById(obj).value = ""
    }    

    if (document.getElementById(obj).value == "E-mail") {
        document.getElementById(obj).value = ""
    }
}

function Preloader(PreImage) 
{
    if (PreImage != ""){
        heavyImage = new Image(); 
        heavyImage.src = PreImage;
    }   
}

/*---------------------------------------------------
    Forside Varekurv
-----------------------------------------------------*/

var xmltarget2

       function UpdateFrontCart(target){
               
        xmltarget2 = target;
     
        if (typeof xmltarget2 != 'undefined'){
	        if (window.XMLHttpRequest) {
		        Load2xmlhttp=new XMLHttpRequest()
		        Load2xmlhttp.onreadystatechange = xmlFrontCart;
		        Load2xmlhttp.open("GET",url+"/include/TopKurv.asp?c=975877754&n=1226003481",true)
		        Load2xmlhttp.send(null)
	        } else if (window.ActiveXObject) {
		        Load2xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		        if (Load2xmlhttp) {
			        Load2xmlhttp.onreadystatechange=xmlFrontCart
				        Load2xmlhttp.open("GET",url+"/include/TopKurv.asp?c=975877754&n=1226003481",true)
			        Load2xmlhttp.send()
		        }
	        }
	    }
	}    
	
    function xmlFrontCart() {
    
    if ((typeof xmltarget2 != 'undefined') || (typeof xmltarget2 != null)){
        if (Load2xmlhttp.readyState == 4) {
	        if (Load2xmlhttp.status == 200) {
		        document.getElementById(xmltarget2).style.display = 'block';
		        document.getElementById(xmltarget2).innerHTML = Load2xmlhttp.responseText;
	        } else {
    //		    alert("Problem ved hentning af data - xmlFrontCart")
    //		    alert(Load2xmlhttp.responseText);
	        }
        }
    }    
    
}

	
/*---------------------------------------------------
    Forside Varekurv SLUT
-----------------------------------------------------*/

/*---------------------------------------------------
    Opdater forside varekurv efter brug af backknap i Firefox og Safari
-----------------------------------------------------*/
var hash

setInterval(function()
{
    if (location.hash != hash)
    {
        UpdateFrontCart('varekurv')
        hash = location.hash;
    }
}, 500);

/*---------------------------------------------------
    Opdater forside varekurv efter brug af backknap i Firefox og Safari SLUT
-----------------------------------------------------*/

/*---------------------------------------------------
    Vis læg i kurv knap ved mouse over
-----------------------------------------------------*/
var WhatDiv

//onmouseover=""javascript:showbasketbutton('button1')"" onmouseout=""javascript:hidebasketbutton('button1')""

function showbasketbutton(DivId){   
    document.getElementById(DivId).style.visibility = 'visible';
}

function hidebasketbutton(DivId){ 
    document.getElementById(DivId).style.visibility = 'hidden';
}

/*---------------------------------------------------
    Vis læg i kurv knap ved mouse over
-----------------------------------------------------*/

/*---------------------------------------------------
    AJAX rightbar start
-----------------------------------------------------*/
var xmltarget3

    function HideRightBar(){
        document.getElementById('container').style.width  = '990px';
        document.getElementById('floatright').style.visibility = 'hidden';
        document.getElementById('floatright').style.width  = '0';
        document.getElementById('floatright').style.height = '0';
    }
        
       function UpdateRightBar(target,GloIntHovedGruppe,GloIntNode,GloIntProductNode){
       
       /* if (GloIntHovedGruppe != 200 || GloIntHovedGruppe == ""){
            HideRightBar()
        }else{*/
           //alert("GloIntHovedGruppe: " + GloIntHovedGruppe + "|" + "GloIntNode: " + GloIntNode + "|"+ "GloIntProductNode: " + GloIntProductNode)

            xmltarget3 = target;
            var xmltarget3url = url + "/rightbar.asp?c=975877754&MainNodeId="+GloIntHovedGruppe+"&n="+GloIntNode+"&pn="+GloIntProductNode+"&yearid="
	        if (window.XMLHttpRequest) {
		        Load3xmlhttp=new XMLHttpRequest()
		        Load3xmlhttp.onreadystatechange = xmlRightBar;
		        Load3xmlhttp.open("GET",xmltarget3url,true)
		        Load3xmlhttp.send(null)
	        } else if (window.ActiveXObject) {
		        Load3xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		        if (Load3xmlhttp) {
			        Load3xmlhttp.onreadystatechange=xmlRightBar
				        Load3xmlhttp.open("GET",xmltarget3url,true)
			        Load3xmlhttp.send()
		        }
	        }
	   // }    
	}

    function xmlRightBar() {
    if (Load3xmlhttp.readyState == 4) {
	    if (Load3xmlhttp.status == 200) {
		    document.getElementById(xmltarget3).style.display = 'block';
		    document.getElementById(xmltarget3).innerHTML = Load3xmlhttp.responseText;
	    } else {
//		    alert("Problem ved hentning af data - xmlRightBar")
//		    alert(Load3xmlhttp.responseText);
	    }
    }
}

/*---------------------------------------------------
    AJAX rightbar SLUT
-----------------------------------------------------*/

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids = ["openinghours"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide = "yes"

var getIEVersion = parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE ")+5).split(";")[0])
var IE8extraHeight = 0
if (getIEVersion == 8){
    IE8extraHeight = 28
}

var FFextraHeight = 0
var getFFVersion = navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
//FFextraHeight = parseFloat(getFFVersion) >= 0.1 ? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
    var dyniframe = new Array()
    for (i = 0; i < iframeids.length; i++) {
        if (document.getElementById)
            resizeIframe(iframeids[i])
        //reveal iframe for lower end browsers? (see var above):
        if ((document.all || document.getElementById) && iframehide == "no") {
            var tempobj = document.all ? document.all[iframeids[i]] : document.getElementById(iframeids[i])
            tempobj.style.display = "block"
        }
    }
}

function resizeIframe(frameid) {
    var currentfr = document.getElementById(frameid)
    if (currentfr && !window.opera) {
        currentfr.style.display = "block"
        if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
            currentfr.height = currentfr.contentDocument.body.offsetHeight + FFextraHeight + IE8extraHeight;
        else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
            currentfr.height = currentfr.Document.body.scrollHeight;
        if (currentfr.addEventListener)
            currentfr.addEventListener("load", readjustIframe, false)
        else if (currentfr.attachEvent) {
            currentfr.detachEvent("onload", readjustIframe) // Bug fix line
            currentfr.attachEvent("onload", readjustIframe)
        }
    }
}

function readjustIframe(loadevt) {
    var crossevt = (window.event) ? event : loadevt
    var iframeroot = (crossevt.currentTarget) ? crossevt.currentTarget : crossevt.srcElement
    if (iframeroot)
        resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url) {
    if (document.getElementById)
        document.getElementById(iframeid).src = url
}

function ResizeIframes(TheFrame,NewSize) {
    document.getElementById(TheFrame).height = NewSize / 1; 
}

function adjustSize() {
/*    var iWidth = (typeof self.innerWidth == "number" ? self.innerWidth : document.body.clientWidth);
    if (iWidth < 1280){
        document.getElementById("floatleft").style.width = 0 +"px";
        //document.getElementById("floatleft").style.visibility = "hidden";
    }
    if (iWidth > 1280){
        
        var container = document.getElementById("container")
        var sparespace = iWidth - 990 - 260
        if (sparespace < 250){
            document.getElementById("floatleft").style.width = sparespace-20 +"px";
            document.getElementById("container").style.width = iWidth-18 + "px"; //(980 + 250 + sparespace) +"px";        
        
        }else{
            document.getElementById("floatleft").style.width = 250 +"px";
            document.getElementById("container").style.width = 990+255+255 +"px";    
        
        }    
    }    */
}

if (window.addEventListener)
    window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
    window.attachEvent("onload", resizeCaller)
else
    window.onload = resizeCaller;
    

/*---------------------------------------------------
    Overfør tracking fra Flash til JScript på siden.
-----------------------------------------------------*/

function swfEvent(myCategory,myAction,myLabel,myValue) {
    var TrackingEvent
    if (myCategory != ""){
        TrackingEvent = myCategory
        
        if (myAction != ""){
            TrackingEvent = TrackingEvent + "," + myAction
            
            if (myLabel != ""){
                TrackingEvent =  TrackingEvent + "," + myLabel
            }
            
            if (myValue != ""){
                TrackingEvent = TrackingEvent + "," + myValue  
            }

            pageTracker._trackEvent(TrackingEvent);
       
        }
    }  
}

/*-----------------------------------------------------*/
function printIframe(id)
{
    var iframe = document.frames ? document.frames[id] : document.getElementById(id);
    var ifWin = iframe.contentWindow || iframe;
    iframe.focus();
    ifWin.printPage();
    return false;
}
