function PopupPic(url) {
try {
	var br=document.getElementById('billede').width-10
	document.frames('billede').document.body.innerHTML='<img src='+url+' width='+br+' align=center>'
	document.frames('billede').document.body.topMargin=3
	document.frames('billede').document.body.leftMargin=3
	return
	}
catch(e) {}

if (url.indexOf(':') >0) {
	url='file://'+url
	}
window.open('popup.htm?'+url,'','resizable=1,Height=200,Width=200,Top=0,Left=0');
	}
function panoxpress(url)	{
re=/ /g
url=url.replace(re,'_')
window.open(url+'/'+'panoxpress.htm','panoxpress','resizable=1,Height=200,Width=200,Top=0,Left=0');
}

function checklink(obj) {
if (obj.target=="main") {
try {
	main.location.href=obj.href;
	window.event.returnValue=false;
	}
catch(e) {
	location.href=obj.href;
	}
	}
}

function winOpenStd(url,type) {

if (type=='Hovedvindue') {
   for (i=0;i<window.parent.frames.length;i++) {
   if (!IE) {
	try 	{
		window.parent.document.getElementById('main').src=url
        	return(0)
		}
	catch(e) {}
	try {
		window.document.getElementById('main').src=url
        	return(0)
	}
	catch(e) {}
    }
    if (IE)  {
	try {
        document.all('main').src=url
        return(0)
        }
	catch(e) {}
    }
    }
    window.open (url)
	return(0)
}
if (type=='Samme vindue') {
try { 
	x=window.frameElement.name;
    parent.main.location.href=url;
     }
catch(e) {
     location.href=url;
         }
return;
 }
if (type=='Nyt vindue') {
  window.open(url);
  return(0)
 }
if (type=='PopUp vindue') {
  window.open(url,'popup','toolbar=no,resizable=yes');
  return(0)
 }

//skal være en iframe under main
try {
	parent.main.frames(type).location.href=url;
	}
catch(e) {
	parent.main.location.href=url;
	}
}

function bestil(ix)	{
var substring="?";
var wreject=0;
var skilletegn	//for kompabilitet med tidligere versioner
for(i = 0; i < document.body.all.length; i++) {
	//alert(document.body.all(i).name)
   if (document.body.all(i).name)  {		// navngivet element
   		if (document.body.all(i).type == "radio") {
   			if (document.body.all(i).checked) {
   			substring=substring+document.body.all(i).name+"="+document.body.all(i).value+"§";
   			}
   		}
   		else
   		{
   		re= /\n/g;
   		//alert(document.body.all(i).name.lastIndexOf("-"));
		skilletegn="_";
		if ((document.body.all(i).name.length - document.body.all(i).name.lastIndexOf("-"))<4) {
			skilletegn="-";
			}
   		if (document.body.all(i).name.substr(document.body.all(i).name.lastIndexOf(skilletegn)+1)==ix)  {
   		substring=substring+document.body.all(i).name+"="+document.body.all(i).value.replace(re,"|")+"§";
		re=/\.\.\./
   		if (document.body.all(i).value.search(re)!=-1) {
			var feltnavn=document.body.all(i).name.substr(0,document.body.all(i).name.lastIndexOf(skilletegn))
   			alert(feltnavn + " er ikke udfyldt");
   			wreject=1;
   			}
   		}
   		}

   	}
}
//alert(substring);
if (wreject == 0) {
	//var ud=eval(document.all.fram+"-1".src);
	//alert ud.name;
	document.all["fram-"+ix].src="ordrelinie.asp"+substring;
	document.all["fram-"+ix].style.display="inline";
	}
}

function rensfelt(dettefelt)	{
	re=/\.\.\./
   	if (dettefelt.value.search(re)!=-1)	{
		dettefelt.value=""
	}

}
function subm(abc)	{
if (document.all.frm.Navn.value.length==0)	{
	alert("Navn ikke udfyldt");
	return;
	}
if (document.all.frm.Adresse.value.length==0)	{
	alert("Adresse ikke udfyldt");
	return;
	}
if (document.all.frm.Postnr.value.length==0)	{
	alert("Postnr ikke udfyldt");
	return;
	}
if (document.all.frm.By.value.length==0)	{
	alert("By ikke udfyldt");
	return;
	}
if (document.all.frm.Telefon.value.length==0)	{
	alert("Telefon ikke udfyldt");
	return;
	}
if (document.all.frm.Email.value.length==0)	{
	alert("E-mail ikke udfyldt");
	return;
	}
window.parent.location.href="ordre2.asp?Navn="+document.all.frm.Navn.value
	+"&Firma="+document.all.frm.Firma.value
	+"&Adresse="+document.all.frm.Adresse.value
	+"&Postnr="+document.all.frm.Postnr.value
	+"&By="+document.all.frm.By.value
	+"&Land="+document.all.frm.Land.value
	+"&Telefon="+document.all.frm.Telefon.value
	+"&Fax="+document.all.frm.Fax.value
	+"&Email="+document.all.frm.Email.value

}

function checkiframe(xhref) {
return(0)
try {
if (document.getElementById(xhref).height.length==0) {
	document.getElementById(xhref).height=document.getElementById(xhref).clientHeight
	}
else	{
	document.getElementById(xhref).height=document.getElementById(xhref).clientHeight
	}
if (document.getElementById(xhref).width.length==0) {
	document.getElementById(xhref).width=document.getElementById(xhref).clientWidth;
	}
else	{
	document.getElementById(xhref).width=document.getElementById(xhref).clientWidth
	}
   }
catch(e) {
	document.getElementById('errinfo').innerHTML="ERR"
  }
}

function xload() {
return(0)
try {
if (document.body.clientWidth<document.body.scrollWidth) {
	diff=document.body.scrollWidth-document.body.clientWidth;
	document.getElementById('main').width=document.getElementById('main').width-diff;
	}
	}
catch(e) { }
try {
if (document.body.clientHeight<document.body.scrollHeight) {
	diff=document.body.scrollHeight-document.body.clientHeight;
	document.getElementById('main').height=document.getElementById('main').height-diff;
	}
	}
catch(e) { }
}
function checkvideo(obj,filnavn)  {
	// server version
	var ix=filnavn.lastIndexOf('/')+1
	var tmpfilnavn=filnavn.substr(ix)
	tmpfilnavn='data/video/'+tmpfilnavn
	obj.parentElement.href=tmpfilnavn
}

