
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function P7AniMagic(el, x, y, a, b, c, s) { //v2.5 PVII
 var g,elo=el,f="",m=false,d="";x=parseInt(x);y=parseInt(y);
 var t = 'g.p7Magic = setTimeout("P7AniMagic(\''+elo+'\','; 
 if ((g=MM_findObj(el))!=null) {d=(document.layers)?g:g.style;}else{return;}
 if (parseInt(s)>0) {eval(t+x+','+y+','+a+','+b+','+c+',0)",' + s+')');return;}
 var xx=(parseInt(d.left))?parseInt(d.left):0;
 var yy=(parseInt(d.top))?parseInt(d.top):0;
 if(parseInt(c)==1) {x+=xx;y+=yy;m=true;c=0;}
 else if (c==2) {m=false;clearTimeout(g.p7Magic);}
 else {var i=parseInt(a);
  if (eval(g.moved)){clearTimeout(g.p7Magic);}
  if (xx<x){xx+=i;m=true;if(xx>x){xx=x;}}
  if (xx>x){xx-=i;m=true;if(xx<x){xx=x;}}
  if (yy<y){yy+=i;m=true;if(yy>y){yy=y;}}
  if (yy>y){yy-=i;m=true;if(yy<y){yy=y;}}}
 if (m) {if((navigator.appName=="Netscape") && parseInt(navigator.appVersion)>4){
    xx+="px";yy+="px";}
  d.left=xx;d.top=yy;g.moved=true;eval(t+x+','+y+','+a+','+b+','+c+',0)",'+b+')');
  }else {g.moved=false;}
}

function user_info()
{
	alert('Benyt venligst login funktionen i højre side!');
	document.getElementById("user").focus();
}
function cutText(text)
{
	
	var s = text.length;
	if(s > 30)
		{
			text = text.substring(0,30); 
		}
		return text;
}
function bannerRotation()
{
	var backgr1="../images/banner/0.gif"
	var backgr2="../images/banner/1.gif"
	var backgr3="../images/banner/2.gif"
	
	var cur=Math.round(6*Math.random())
	
	if (cur<=1)
	backgr=backgr1
	else if (cur<=4)
	backgr=backgr2
	else
	backgr=backgr3
	document.getElementById("banner").src= backgr;

}

function initDropdown()
{
	//alert(document.getElementById("produkter").offsetParent.clientLeft);

	if(screen.width==800)
	{
		document.getElementById("produkter").style.left = 493;
		document.getElementById("webdesign").style.left = 560;
	}
	if(screen.width==1024)
	{
		document.getElementById("produkter").style.left = 575;
		document.getElementById("webdesign").style.left = 655;
	}
	if(screen.width==1280)
	{
		document.getElementById("produkter").style.left = 568;
		document.getElementById("webdesign").style.left = 635;
	}
	if(screen.width==1600)
	{
		document.getElementById("produkter").style.left = 728;
		document.getElementById("webdesign").style.left = 795;
	}
}

function formatHTML(txt,tlf)
{
	sText = txt.replace(' ','+');
	
	t='?username=qed&password=q3dsms&message=ring til+'+tlf+ '. Besked:'+ sText+'&to=4551806461,452235885&from=QED+tilkald'
	return t;
}
