var invLines;

	function makeTools(lang){
		var retStr="";
			if(lang=="dk"){
				retStr+="<a href='javascript:printPage()' class='tools'>print</a><br>"
				retStr+="<a href='#' class='tools'>Kontakt</a><br>"
				retStr+="<a href='javascript:openLogin()' class='tools'>login</a>"
				document.write(retStr);
				return false;
			}
			
	}


	function signupNewsletter(){
			frm = document.getElementById("signupFrm")
			
			m = document.getElementById("email")
			
			if(m.value == ""){
				m.focus();
				m.style.borderColor="red"
				return false;
			}else{
				m.style.borderColor=""
			}
			
			if(m.value == "" || m.value.indexOf("@")==-1){
				m.focus();
				m.style.borderColor="red"
				return false
			}else{
				m.style.borderColor=""
			}
			
			frm.submit();
		}
			


	
	function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
	}
	
function printPage(){
	MM_openBrWindow('/print.asp','print','scrollbars=yes,resizable=yes,width=650,height=650')	
}

function openSitemap(){
	MM_openBrWindow('/mod_inc/?p=siteMap&thisPage=','siteMap','scrollbars=yes,resizable=yes,width=440,height=550')	
}

function checkSendToFriend(){
	mailObj=getObj('reciever-mail');
	nameObj=getObj('sender-name');
	bodyObj=getObj('mailbody');
	
	if(mailObj.value=="" || mailObj.value.indexOf('@')<1 ){
		globStatus=false
		alert('Feltet: "Vens email" skal indeholde en gyldig email');
		mailObj.focus();
		return false
	}
	
	if(nameObj.value==""){
		globStatus=false
		alert('Feltet: "Dit navn" skal udfyldes!');
		nameObj.focus();
		return false
	}	
	bodyObj.value=bodyObj.value.replace(/%name%/,nameObj.value);
	
	return true;
}

function sendToFriend()
{
	MM_openBrWindow('/sendtoFriend.asp?extUrl='+document.location,'sendToFriend','scrollbars=yes,resizable=yes,width=236,height=190')
}

function getCookiebyName(sName)
{
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }

  // a cookie with the requested name does not exist
  return "";
}


function hndlInp(obj,state){
	if(state){
		obj.className = obj.className+"Active"	
	}else{
		obj.className = obj.className.toString().replace(/Active/gi,"")
	}
	}

function zoom(){			
	var exp = new Date()
	expCalc = exp.getTime() + (7*24*60*60);
	exp.setTime(expCalc);
	if(document.cookie.indexOf("zoomed=true")>-1){
		document.body.style.zoom="100%"
		document.cookie = "zoomed=false; expires=" + exp.toGMTString();
		document.getElementById("zoomIcon").src="/gfx/icons/zoomIn.gif"
	}else{
		document.body.style.zoom="150%"
		document.cookie = "zoomed=true; expires=" + exp.toGMTString();
		document.getElementById("zoomIcon").src="/gfx/icons/zoomOut.gif"
	}
}

function openLogin(obj){

	MM_openBrWindow('/loginExtranet.asp','extranetlogin','scrollbars=no,resizable=no,width=289,height=266')

}

function zoom(){			
	var exp = new Date()
	expCalc = exp.getTime() + (7*24*60*60);
	exp.setTime(expCalc);
	if(document.cookie.indexOf("zoomed=true")>-1){
		document.body.style.zoom="100%"
		document.cookie = "zoomed=false; expires=" + exp.toGMTString() + "; path=/";
		document.getElementById("zoomIcon").src="/gfx/icons/zoomIn.gif"
	}else{
		document.body.style.zoom="150%"
		document.cookie = "zoomed=true; expires=" + exp.toGMTString() + "; path=/";
		document.getElementById("zoomIcon").src="/gfx/icons/zoomOut.gif"
	}
}

function documentLoaded(){
	//set zoom level 
	
}


function popWin(url,width,height){
	MM_openBrWindow(url,'siteMap','scrollbars=yes,resizable=yes,width='+width+',height='+height)	
}





	function bannerObj(){
		this.imgs = new Array();
		this.imgsrc = new Array();
		this.img = 0;
		this.filterStr = "";
		this.timeBetween = 0;
		this.htmlImage=null
		this.width = 0;
		this.height = 0;
		
		this.addImage = __addBannerImage;
		this.start = __startBanner;
		
		this.changeBanner = __changeBanner;
		
		this.timer=null
		return this;
	}
	
	function __addBannerImage(src){
		this.imgsrc[this.imgsrc.length] = src;
	}
	
	function __startBanner(){
		var dStr
		if(this.htmlImage!=null){
		this.img==-1 ? this.img = parseInt(Math.random() * this.imgsrc.length):null;
		
		this.img > this.imgsrc.length ? this.img=0:null;
		//preload images
		for(i=this.img;i<this.imgsrc.length;i++){
			this.imgs[i]=new Image();
			this.imgs[i].src=this.imgsrc[i];
			dStr+="\n"+this.imgs[i].src
		}

		for(i=0;i<this.img;i++){
			this.imgs[i]=new Image();
			this.imgs[i].src=this.imgsrc[i];
			dStr+="\n"+this.imgs[i].src
		}
		//preload Images END
		this.htmlImage.src = this.imgs[this.img].src
		obj=this

		this.changeBanner(obj)
		}
	}
	
	function __changeBanner(obj){
		if(this.htmlImage){
			if(document.all){
				this.htmlImage.style.filter=this.filterStr;
				this.htmlImage.filters[0].apply();
				this.htmlImage.src=this.imgs[this.img].src;
				this.htmlImage.filters[0].play();
				this.img++
			}
			if(this.img == this.imgs.length){
				this.img=0
			}
		}
		
		//window.setTimeout("__changeBanner(obj)",obj.timeBetween)
	}