function GalleryPopUp(file)
{
	CsitePopup('galleripopup.php?file=/upload/Galleri/' + file, 'GalleriPopUp', 'Vent venligst...', true, 0, 0, 660, 460, false, false, false, false, false, false);
}

function WMVPopUp(file, w, h)
{
	CsitePopup('wmv.php?file=' + file + '&width=' + w + '&height=' + h, 'WMVPopUp', 'Vent venligst...', true, 0, 0, w, h, false, false, false, false, false, false);
}

function ProjekterPopUp(file)
{
	CsitePopup('/upload/' + file, 'ProjekterPopUp', 'Vent venligst...', true, 0, 0, 660, 460, false, false, false, false, false, false);
}

function EjendommePopUp(file)
{
	CsitePopup('/upload/' + file, 'EjendommePopUp', 'Vent venligst...', true, 0, 0, 660, 460, false, false, false, false, false, false);
}

function GalleryPopUpStream(file,w,h)
{
	CsitePopup('stream.php?file=' + file + '&width=' + w + '&height=' + h, 'GalleriPopUpStream', 'Vent venligst...', true, 0, 0, w, h, false, false, false, false, false, false);
}


function GalleryPopUpFlash(file,w,h)
{
	CsitePopup('flash.php?file=' + file + '&width=' + w + '&height=' + h, 'GalleriPopUpFlash', 'Vent venligst...', true, 0, 0, w+50, h+50, false, false, false, false, false, false);
}

function GalleryPopUpModel(file)
{
	CsitePopup('3dmodel.php?file=' + file, 'GalleriPopUpModel', 'Vent venligst...', true, 0, 0, 450, 300, false, false, false, false, false, false);
}

function CsitePopup(url, target, text, positioncenter, top, left, width, height, resizable, scrollbars, toolbar, location, directories, menubar)
{

  // Default values

  if (isNaN(parseInt(top))) top = 0;

  if (isNaN(parseInt(left))) left = 0;

  if (isNaN(parseInt(height))) height = 240;

  if (isNaN(parseInt(width))) width = 320;

  if (resizable) resizable = 'yes'; else resizable = 'no';

  if (scrollbars) scrollbars = 'yes'; else scrollbars = 'no';

  if (toolbar) toolbar = 'yes'; else toolbar = 'no';

  if (location) location = 'yes'; else location = 'no';

  if (directories) directories = 'yes'; else directories = 'no';

  if (menubar) menubar = 'yes'; else menubar = 'no';

 

  // Position the windows at the center of the screen.

  if (positioncenter && screen && screen.height && screen.width) {

  top = (screen.height - height)/2;

  left = (screen.width - width)/2;

  }

  if (text != '') {

  var popupwin = window.open('', target, "top="+top+",left="+left+",width="+width+",height="+height+",resizable="+resizable+",scrollbars="+scrollbars+",toolbar="+toolbar+",location="+location+",directories="+directories+",menubar="+menubar);

  popupwin.document.write(text);

  popupwin.document.location.href = url;

  } else {

  var popupwin = window.open(url, target, "top="+top+",left="+left+",width="+width+",height="+height+",resizable="+resizable+",scrollbars="+scrollbars+",toolbar="+toolbar+",location="+location+",directories="+directories+",menubar="+menubar);

  }
}
