function init(){
  try {
	  if(document.images['img9'] != undefined){
		  //document.images['img9'].src = '/x.gif';
	  }
	  TransformTheMenu();
  	
	  var allTds = document.getElementById('FlexaMenuContainer').getElementsByTagName('TD');
	  //var menuObj;
	  for(var i=0;i<allTds.length;i++){
		  //if(allTds[i].className == 'c1'){
			  var tmpObj = allTds[i];
			  //alert(tmpObj.outerHTML)
			  if(tmpObj.innerHTML.indexOf('L1_Active')!= -1){
				  //alert(tmpObj.className)
				  tmpObj.style.backgroundColor= '#fdb813'
				  //tmpObj.style.color= '#000000'
			  }
		  //}
	  }
  } catch(e) {
	}
}

function TransformTheMenu(){
  try {
	  // we need to dp some work on the menu
	  // we will find it be its container id (set in html)
	  var  menuObj = document.getElementById('FlexaMenuContainer')
	  menuObj.style.display = 'none';
	  var strNewMenu = menuObj.innerHTML
	  // remowe empty cells
	  var regEx = /\<td\>\&nbsp\;\&nbsp\;\<\/td\>/gi 
	  strNewMenu = strNewMenu.replace(regEx,"")
  	
	  // add a classname in tds
	  var regEx2 = /(id=\"*MM\d+\"*)/gi 
	  strNewMenu = strNewMenu.replace(regEx2,'$1 class="FlexaMenuL1" onmouseOver="MenuTdOnMouseOver(this)" onmouseOut="MenuTdOnMouseOut(this)"')

	  menuObj.innerHTML = strNewMenu

	  if(menuObj.childNodes.length > 1){
		  menuObj.childNodes[1].style.height = '30px'
	  }
	  else{
		  menuObj.childNodes[0].style.height = '30px'
	  }
  	
	  menuObj.style.display = 'block';
	} catch(e) {
	}
}
var CurrentMainMenuId = 0
var PreviusMainMenuId = 0
function MenuTdOnMouseOver(obj){
	CurrentMainMenuId = obj.id.substring(2)
	cancelBobble = true;
	obj.style.backgroundColor = '#ff0000';
}
function MenuTdOnMouseOut(obj){
	cancelBobble = true;
	if(obj.innerHTML.indexOf('L1_Active')!= -1){
		obj.style.backgroundColor= '#fdb813'
	}
	else{
		if(document.getElementById('submenu' + obj.id.substring(2)) != undefined && CurrentMainMenuId == obj.id.substring(2)){
			obj.style.backgroundColor = 'red';
			if(PreviusMainMenuId > 0 && PreviusMainMenuId != CurrentMainMenuId){
				document.getElementById('MM' + PreviusMainMenuId).style.backgroundColor = '';
			}
				PreviusMainMenuId = CurrentMainMenuId
		}
		else{
			obj.style.backgroundColor = '';
		}
	}
}

function openInNewWindow(sUrl, sWidth, sHeight, bNoResize, sFeatures) {
  if (sUrl=='') return;
  if (arguments.length<5) {
    // Anvend standard features = minimum features
    sFeatures = 'channelmode=0,directories=0,fullscreen=0,location=0,menubar=0,status=0,titlebar=1,toolbar=0,';
  } else {
   sFeatures+=','
  }
  sFeatures+= 'resizable='+((typeof bNoResize!='undefined') ? ((bNoResize==true) ? '1' : '0') : '1')+',';
  sFeatures+= (sWidth) ? 'width='+sWidth+',' : '';
  sFeatures+= (sHeight) ? 'height='+sHeight+',' : '';
  var oWindow = window.open(sUrl, '_blank', sFeatures);
}


/**
 * SWFObject v1.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 formarly 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.createElement||!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(this.getAttribute("version"),_7);
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(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}
return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[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(_2b){
var q=document.location.search||document.location.hash;
if(q){
var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){
return q.substring(q.indexOf("=",_2d)+1,_2e);
}}return "";}};
if(Array.prototype.push==null){
Array.prototype.push=function(_2f){
this[this.length]=_2f;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject; // for backwards compatibility
var SWFObject=deconcept.SWFObject;

/* SH: 2006.08.22: Katalogbestilling p? forskellige sprog, herunder validering af postnumre
  Belgien	Best?r af tal	1180
  Danmark	Best?r af tal	5464
  England	Best?r af bogstaver og tal	GB CM2 6FL
  Frankrig	Best?r af tal	69002
  Holland	Best?r af tal og bogstaver	9202 TE
  Irland	Irland har ingen postnr.	
  Italien	Best?r af tal	50127
  Luxembourg	Best?r af tal	5752
  Portugal	Best?r af tal og en "bindestreg"	4150-517
  Schweiz	Best?r af tal	6074
  Spanien	Best?r af tal	11300
  Tyskland	Best?r af tal	41751
  ?strig	Best?r af tal	4020
  >>>>>>>>>>>> 
*/

// Default tekster
var sLande      = 'Please type country';
var sPostnummer = 'Please type postcode';
var sBy         = 'Please type city';
var sNavn       = 'Please type your name'
var sAdresse    = 'Please type your address';
var sEmail      = 'Please type e-mail';

var areaIdCountryCodeRelation = {
  1:'dk', 4:'de', 5:'uk', 6:'es', 7:'fr', 8:'nl', 9:'us', 10:'it',
  11:'be', 12:'be', 13:'at', 14:'ch', 15:'ch', 16:'ch', 17:'lu', 18:'lu', 19:'cn',
  21:'dk', 22:'it', 23:'fr', 24:'es', 25:'us', 26:'it', 27:'it', 28:'dk', 29:'uk'
}

var oRegExp_NoValidation  = /.*/ig;
var oRegExp_DDDD          = /^\d{4}$/ig;
var oRegExp_DDDDD         = /^\d{5}$/ig;
var oRegExp_DDDDDD        = /^\d{6}$/ig;
var oRegExp_Uk            = /[A-Z][A-Z]?[0-9][A-Z0-9]? ?[0-9][ABDEFGHJLNPQRSTUWXYZ]{2}/ig
var oRegExp_DDDD_AA       = /^\d{4}.[A-Z]{2}$/ig;
var oRegExp_DDDD_DDD      = /^\d{4}-\d{3}$/ig;

// countryCode:[regExpToUse, bLooseValidation]
// bLooseValidation => "not sure if postcode should confirm 100% to validator" :-(
var countryCodeRegExpRelation = {
  dk:[oRegExp_DDDD, false],
  be:[oRegExp_DDDD, false],
  uk:[oRegExp_Uk, true],
  fr:[oRegExp_DDDDD, false],
  nl:[oRegExp_DDDD_AA, false],
  it:[oRegExp_DDDDD, false],
  lu:[oRegExp_DDDD, false],
  po:[oRegExp_DDDD_DDD, false],
  ch:[oRegExp_DDDD, false],
  es:[oRegExp_DDDDD, false],
  de:[oRegExp_DDDDD, false],
  at:[oRegExp_DDDD, false],
  cn:[oRegExp_DDDDDD, true],
  us:[oRegExp_NoValidation, true],
  UNKNOWN:[oRegExp_NoValidation, true]
}

function trim(sText) {
  var sResult = sText.replace(/^[\s]+|[\s]+$/g, '').replace(/-*/g, '');
  return sResult;
}


function validate(sId) {
  var oElement = document.getElementById(sId);
  if (oElement) {
    var sValue = trim(oElement.value);
    oElement.value = sValue;
    var oRegExpInfo = getRegExpForCountry(sLande);
    if (oRegExpInfo) {
      if (oRegExpInfo[1]==true) {
        // Loose validation
        return true
      } else {
        // Strict validation
        if (sValue.match(oRegExpInfo[0])!=null) {
         return true
         } else {
           alert(sPostnummer);
           //oElement.focus();
           return false;
         }
      }
    }
  }
}

function getRegExpForCountry(sMsgNoneSelected) {
  var oElementWithCountryCode = document.getElementById('countrycodeByCountryName');
  var sCountryCode = oElementWithCountryCode.value;
  if (sCountryCode=='') {
    oElementWithCountryCode.focus();
    return
  }
  document.getElementById('land').value = oElementWithCountryCode.options(oElementWithCountryCode.selectedIndex).text;
  var oRegExp = countryCodeRegExpRelation[sCountryCode];
  if (typeof oRegExp=='undefined') {
    oRegExp = countryCodeRegExpRelation['UNKNOWN'];
  }
  return oRegExp;
}

function erUdfyldt(sId, sFejltekst) {
  var oElement = document.getElementById(sId);
  if (trim(oElement.value)=='') {
    alert(sFejltekst)
    oElement.focus();
    return false;
  } else {
    return true;
  }
}

function checkAll() {
  if (validate('postcode')) {
    if (!erUdfyldt('navn', sNavn)) {
      return false
    }
    if (!erUdfyldt('Adresse', sAdresse)) {
      return false
    }
    if (!erUdfyldt('by', sBy)) {
      return false
    }
    
    var oMailadresse = document.getElementById('mailadresse');
    if (!validateEmail(oMailadresse.value)) {
      alert(sEmail);
      oMailadresse.focus();
      return false
    }
    return true; //FormCheck1();
  } else {
    return false;
  }
}
/* SH: 2006.08.22: Katalogbestilling p? forskellige sprog, herunder validering af postnumre <<<<<<<<<< */

/*
 * Cookie functions START ------------------- 
 */
/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain) {
    if (getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}
/*
 * Cookie functions END ------------------- 
 */
 
// Eksempel: addEvent(window, 'load', move)
function addEvent(oElement, sEventName, vDelegate) {
 var oResult;
 if (oElement.addEventListener) {
    oResult = oElement.addEventListener(sEventName, vDelegate,true)
 } else {
   oResult = oElement.attachEvent('on'+sEventName, vDelegate);
 }
 return oResult
}

function Confirm(sText, sURL) {
  if (confirm(sText)) {
    document.location.href = sURL;
    document.location.reload();
    return true;
  } else {
    return false;
  }
}

/* Retunerer en hash table der indeholder Name-Value v?rdier af
   querystringen p? siden, samt en numereret liste over Names
   i hashtablen.
   Eks: mypage.aspx?hello=world&goodbye=world 
   [0]=hello, [1]=goodbye, [hello]=world, [goodbye]=world
*/
function getParamsHashtable() {
  try {
    var sSearch = document.location.search;
    sSearch = sSearch.substr(1, sSearch.length-1);
    var aTemp = sSearch.split('&');
    var aParams = new Array();
    for(var i=0; i<aTemp.length; i++) {
       var aNameValue = aTemp[i].split('=');
       aParams[i] = aNameValue[0];
       aParams[aNameValue[0]] = aNameValue[1];
    }
    return aParams
  } catch(e) {
    reportError('getParamsHashtable', e, arguments);
  }
}
function showFullscreen(url)
{
	height = screen.availHeight;
	width = screen.availWidth;
	
	// Windows 2k fix
	if(navigator.userAgent.indexOf('Windows NT 5.0') != -1)
	{
		height = height - 20;
		width = width - 10;
	}

	try{
		tmp = window.open(url, 'tmp', "height=" + height + "px,width=" + width + "px,top=0,left=0,location=0,menubar=0,resizable=0,scrollbars=0,toolbar=0");
		tmp.resizeTo(width, height);
	}
	catch(e) {;}
}


// Laver find/replace vha. RegExp i teksten som ligger i sTemplate og skriver den ud paa skaermen
// V?rdierne der erstattes er fra 0...:
// %0% erstattes med f?rste v?rdi i aValues osv.
// Template kunne f.eks. vaere: 
// sMyTemplate = '<img src="%0%.jpg" title="%1%\n(Nr:%0%)>'
// kalde man s?:
// writeTemplate(sMyTemplate, ['1234', 'Dette er en god vare!'])
// ==>
// <img src="1234.jpg" title="Dette er en god vare!\n(Nr:1234)>
//
function writeTemplate(sTemplate, aValues) {
  document.write(passTemplate(sTemplate, aValues));
}
// Laver find/replace vha. RegExp i teksten som ligger i sTemplate og retunerer denne vaerdi
// Vaerdierne der erstattes er fra 0...:
// %0% erstattes med foerste vaerdi i aValues osv.
function passTemplate(sTemplate, aValues) {
  var sResult = sTemplate;
  for(var i=0; i<aValues.length; i++) {
    try {
      var oRegExp = new RegExp('(%'+i+'%)', 'ig');
      sResult = sResult.replace(oRegExp, aValues[i]);
    } catch(e) {
      alert('passTemplate:'+e.description)
    }
  }
  return sResult
}

function findCorrectImage(e) {
  var oImg = (e) ? ((e.srcElement) ? e.srcElement : e.currentTarget) : event.srcElement;
  var sUrl = oImg.src;
  var sNewUrl = removeLast(sUrl)
  if (sNewUrl!=sUrl) {
    oImg.src=sNewUrl;
  }
  else
  {
    oImg.src = 'http://www.flexa.dk/x.gif';
  }
}

function removeLast(s) {
  var i = s.lastIndexOf('.');
  return (s.substr(i-1, 1)!='/') ? s.substr(0, i-1)+s.substr(i, s.length-i) : s;
}
    
function gotoURL(sUrl, sWidth, sHeight, bNoResize, sFeatures) {
  try {
    if (sWidth)
    {
      openInNewWindow(sUrl, sWidth, sHeight, bNoResize, sFeatures);
    }
  } catch(e) {}
  
  document.location.href = sUrl;

}



function copy2Clipboard(sText) {
  sText = sText+'';
  try {
  if (window.clipboardData) {
    // the IE-manier
    window.clipboardData.setData("Text", sText);
  } else if (window.netscape) { 
    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
    var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
    if (!clip) return;
    var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
    if (!trans) return;
    trans.addDataFlavor('text/unicode');
    var str = new Object();
    var len = new Object();
    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
    var copytext=sText;
    str.data=copytext;
    trans.setTransferData("text/unicode",str,copytext.length*2);
    var clipid=Components.interfaces.nsIClipboard;
    if (!clip) return false;
    clip.setData(trans,null,clipid.kGlobalClipboard);
  }
  } catch(e) {
  }
  return false;
}

    
    /* formatNumber(num,dec,thou,pnt,currPre,currPost,negativePre,negativePost)
   Formats a number allowing to controle various general number formatting options:
   num          = The number
                  If not a number formatNumber returns the original value.
   dec          = How many decimal points (rounding point) ?
                  The number will be rounded.
   thou         = Thousind seperator.
                  Leave out if you do not wish one...
   pnt          = Which char should be used as decimal point?
                  Leave out if you do not wish one...
   currPre      = Text to prefix the number with...
                  For instance "? " (Euro):
                  "? 1,000.00"
   currPost     = Text to postfix the number with...
                  For instance " DKK" (Danish Kroner)
                  "1.000,00 DKK"
   negativePre  = If negative insert this before number
                  formatNumber(-1000, 2, '.', ',', '', ' DKK', ' -', '', '') =>
                  "-1.000,00 DKK"
   negativePost = If negative insert this after number
                  For instance "-":
                  formatNumber(-1000, 2, '.', ',', '', 'DKK', '', '- ', '') =>
                  "1.000,00- DKK"
  EKSAMPLE:
  formatNumber(1234.544, 2, '.', ',', 'DKK ', '', '(', ')', '') ==> DKK 1.234,54
  formatNumber(1234, 2, '.', ',', 'DKK ', '', '(', ')', '') ==> DKK 1.234,00
*/
function formatNumber(num,dec,thou,pnt,currPre,currPost,negativePre,negativePost) {
  var originalNum = num;
  num = parseFloat(num);
  if (isNaN(num)) return originalNum;

  if (num>=0) negativePre=negativePost = '';

  var sSign = (num<0) ? '-' : '';
  var x = Math.round(num * Math.pow(10,dec));
  var y = (''+Math.abs(x)).split('');
  var z = y.length-dec;
  // if (z<0) z-;
  for(var i = z; i < 0; i++) y.unshift('0');y.splice(z, 0, pnt); while (z > 3) {z-=3; y.splice(z,0,thou);}
  var r = currPre+negativePre+y.join('')+negativePost+currPost;
  return r;
}

function writeECOM_formattedNumber(sPrice) {
  document.write(formatPrice(sPrice))
  //document.write(formatNumber(sPrice,2,'.', ',', '', '', '', ''))
}

var decimalSeparator = ',';
var thousandsSeparator = ' ';
function formatPrice(sPrice) {
  return formatNumber(sPrice.toString().replace(new RegExp(',', 'ig'), ''),2,thousandsSeparator, decimalSeparator, '', '', '', '');
  /*
  sPrice = sPrice+'';
  if (sPrice.indexOf('.')==-1) {
    return sPrice+'.-&#160;'
  } else {
    return sPrice.replace('.00', '.-&#160;')
  }
  */
}

function getXMLObject(sXML) {
  var oXMLObject;
  try {
    oXMLObject = new DOMParser().parseFromString(sXML, 'text/xml');
  } catch(e) {
    try {
      oXMLObject = new ActiveXObject('Microsoft.XMLDOM');
      oXMLObject.loadXML(sXML);
    } catch(e) {
    }
  }
  return oXMLObject;
};

function toggleID(sId) {
  if (document.getElementById(sId).toggle) {
    document.getElementById(sId).toggle()
  } else {
    document.getElementById(sId).style.display = (document.getElementById(sId).style.display=='none') ? 'block' : 'none';
  }
}
function godkend(sTekst, sPath) {
  if (confirm(sTekst)) {
    gotoURL(sPath);
  }
}
function emptyCard() {
  gotoURL('default.aspx?id='+sDwPageID+'&CartCmd=EmptyCart');
}
