// image pop-up
PositionX = 0;
PositionY = 0;
defaultWidth  = 800;
defaultHeight = 600;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
if(defaultHeight > screen.height)
{
	var optNN='scrollbars=yes,width='+defaultWidth+',height='+screen.heigth+',left='+PositionX+',top='+PositionY;
}
else if(defaultWidth > screen.width)
{
	var optNN='scrollbars=yes,width='+screen.width+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
}
else if((defaultWidth > screen.width) && (defaultHeight > screen.height))
{
	var optNN='scrollbars=yes,width='+screen.width+',height='+screen.height+',left='+PositionX+',top='+PositionY;
}
else
{
	var optNN='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
}
var optIE='scrollbars=yes,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=130-(document.body.clientWidth-document.images[0].width);');
writeln('height=120-(document.body.clientHeight-document.images[0].height);');
writeln('if(width > screen.width){width = screen.width-50;}');
writeln('if(height > screen.height){height = screen.height-50;}');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');   
writeln('window.innerWidth=width;');writeln('window.innerHeight=height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=#ffffff scroll="auto" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=#ffffff scroll="" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"><p style="text-align:center;font-size:80%;color:#61656f;font-weight:bold;">Luk vindue, tryk venstre-mus undenfor vindue</p></body></html>');
close();		
}}


/********************************************/
var floatiewidth="500px";
var floatieheight=""
var floatiebgcolor="lightyellow"
var fadespeed=10
var baseopacity=0

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",fadespeed)
}

function instantset(degree){
cleartimer()
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function paramexists(what){
return(typeof what!="undefined" && what!="")
}

function showfloatie(thetext, e, optbgColor, optWidth, optHeight){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
var floatobj=document.getElementById("dhtmlfloatie")
floatobj.style.left="-900px"
floatobj.style.display="block"
floatobj.style.backgroundColor=paramexists(optbgColor)? optbgColor : floatiebgcolor
floatobj.style.width=paramexists(optWidth)? optWidth+"px" : floatiewidth
floatobj.style.height=paramexists(optHeight)? optHeight+"px" : floatieheight!=""? floatieheight : ""
floatobj.innerHTML=thetext
var floatWidth=floatobj.offsetWidth>0? floatobj.offsetWidth : floatobj.style.width
var floatHeight=floatobj.offsetHeight>0? floatobj.offsetHeight : floatobj.style.width
var winWidth=document.all&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winHeight=document.all&&!window.opera? ietruebody().clientHeight : window.innerHeight-15
e=window.event? window.event : e
floatobj.style.left=dsocx+((winWidth-floatWidth)/2)-5+"px"
if (e.clientX>winWidth-floatWidth && e.clientY+20>winHeight-floatHeight)
floatobj.style.top=dsocy+5+"px"
else
floatobj.style.top=85+"px"

slowhigh(floatobj)
}

function hidefloatie(){
var floatobj=document.getElementById("dhtmlfloatie")
floatobj.style.display="none"
}

function popUp(URL) {
popwin = window.open(URL, 'popwin', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=600, height=400, left = 100,top = 50');
popwin.focus();
}

function CheckForm( theform )
{
    var bMissingFields = false;
    var strFields = "";

    if( theform.fornavn.value == ''){bMissingFields = true;strFields += "     Indtast: Fornavn\n";}
    if( theform.efternavn.value == '' ){bMissingFields = true;strFields += "     Indtast: Efternavn\n";}
    if( theform.adresse.value == '' ){bMissingFields = true;strFields += "     Indtast: Adresse\n";}
    if( theform.bynavn.value == '' ){bMissingFields = true;strFields += "     Indtast: By navn\n";}
    if( theform.postnr.value == '' ){bMissingFields = true;strFields += "     Indtast: Post nummer.\n";}
    if( theform.telefon.value == '' ){bMissingFields = true;strFields += "     Indtast: Telefon nummer.\n";}
    if( theform.kemail.value == '' ){bMissingFields = true;strFields += "     Indtast: E-mail adresse.\n";}
    if( bMissingFields ) {alert( "Du mangler at indtaste noget information i formularen inden bestilling kan sendes! :\n\n" + strFields );
        return false;}
    return true;
}