function vistippopup()
{
	var profiltip = document.getElementById('divtipenven');
	var b=400;
	var h=250;
	
	xc = Math.round((getClientWidth()/2)-(b/2));
	yc = Math.round((getClientHeight()/2)-(h/2));
	profiltip.style.left = xc + "px";
	profiltip.style.top = yc + "px";
	
	stopstartscroll('no');
	showdes('divtipenven','block');
	showdes('divprofilfade','block');
}

function vishvervpopup()
{
	var profiltip = document.getElementById('divhvervenven');
	var b=400;
	var h=250;
	
	xc = Math.round((getClientWidth()/2)-(b/2));
	yc = Math.round((getClientHeight()/2)-(h/2));
	profiltip.style.left = xc + "px";
	profiltip.style.top = yc + "px";
	
	stopstartscroll('no');
	showdes('divhvervenven','block');
	showdes('divprofilfade','block');
}

function vispostkortpopup()
{
	var postkort = document.getElementById('divpostkort');
	var b=700;
	var h=470;
	
	xc = Math.round((getClientWidth()/2)-(b/2));
	yc = Math.round((getClientHeight()/2)-(h/2));
	postkort.style.left = xc + "px";
	postkort.style.top = yc + "px";
	
	stopstartscroll('no');
	showdes('divpostkort','block');
	showdes('divprofilfade','block');
}

function checkinput ( form )
{
  if (form.vensemail.value == "") {
    alert( "Indtast venligst din vens e-mail" );
    form.vensemail.focus();
//    return false ;
  } else if (form.ditnavn.value == "") {
    alert( "Indtast venligst dit navn" );
    form.ditnavn.focus();
//    return false ;
  } else if (form.dinemail.value == "") {
    alert( "Indtast venligst din e-mail" );
    form.dinemail.focus();
//    return false ;
  } else {
	document.tipenven.submit()  
  }

//  return true ;
}

function checkinputhverv ( form )
{
  if (form.vensemail.value == "") {
    alert( "Indtast venligst din vens e-mail" );
    form.vensemail.focus();
//    return false ;
  } else if (form.ditnavn.value == "") {
    alert( "Indtast venligst dit navn" );
    form.ditnavn.focus();
//    return false ;
  } else if (form.dinemail.value == "") {
    alert( "Indtast venligst din e-mail" );
    form.dinemail.focus();
//    return false ;
  } else {
//	document.hvervenven.submit()  
	form.submit()  
  }

//  return true ;
}

     function getClientWidth() {
       return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
     }
     
     function getClientHeight() {
       return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
     }
     
	var Pic = new Array()
	Pic[0] = 'images/1920x1200_DSBBaggrund.jpg'
	Pic[1] = 'images/1680x1050_DSBBaggrund.jpg'
	Pic[2] = 'images/1440x900_DSBBaggrund.jpg'
	Pic[3] = 'images/1280x1024_DSBBaggrund.jpg'
	Pic[4] = 'images/1024x768_DSBBaggrung.jpg'
	Pic[5] = 'images/800x600_DSBBaggrund.jpg'

	function SetHeight(HeightX) {
			if ( HeightX >= 1920 ) {
				return 0;
			} else if ( HeightX >= 1680 ) {
				return 0;
			} else if ( HeightX >= 1440 ) {
				return 1;
			} else if ( HeightX >= 1280 ) {
				return 2;
			} else if ( HeightX >= 1024 ) {
				return 3;
			} else {
				return 4;
			}
	}

     function SetBackImg() {
     	WinX = getClientWidth();
     	WinY = getClientHeight();

     	MinX=SetHeight(WinX);
     	if ( WinY <= 768 ) {
	     	MinY=4
     	} else if ( WinY <= 1024 ) {
	     	MinY=3
     	} else if ( WinY <= 900 ) {
	     	MinY=2
     	} else if ( WinY <= 1050 ) {
	     	MinY=1
     	} else if ( WinY <= 1200 ) {
	     	MinY=0
     	} else if ( WinY > 1200 ) {
	     	MinY=0
     	}
     	Min = MinX
     	if (MinY<MinX) { Min = MinY }

     	if (MinY==3 && MinX==2) { Min = 1}

     	image = Pic[Min];
//     	alert(WinX+' '+WinY+' '+MinX+' '+MinY+' '+image);

		if (document.body){
			document.body.background = image;
		}
     }
