function isset(myVar) {
  var undefined;
  if (myVar != undefined) {
    return true;
  } else {
    return false;
  }
}
function OpenVenster(url,popup_width,popup_height,scrollbars) {
	var undefined;
	if (popup_width == undefined) popup_width=800;
	if (popup_height == undefined) popup_height=600;
	if (scrollbars == undefined) scrollbars='no';
	left_pos = (screen.availWidth/2) - (popup_width / 2);
	top_pos = (screen.availHeight/2) - (popup_height / 2);
	newWindow = window.open(url,'popup','height=' + popup_height + ',left=' + left_pos + ',top=' + top_pos + ',width=' + popup_width + ',scrollbars=' + scrollbars);
	newWindow.focus();

}

function viewimage(image,width,height) {
  OpenVenster('/include/php/image.php?img=' + image,width,height);
}

function getxcenter(objwidth) { 
   var value = Math.floor(getscreenwidth()/2); 
   if (isset(objwidth)) { 
     value = value - Math.floor(objwidth/2); 
   } 
   value = value + getverscroll(); 
   return value; 
 } 
 function getycenter(objheight) { 
   var value = Math.floor(getscreenheight()/2); 
   if (isset(objheight)) { 
     value = value - Math.floor(objheight/2); 
   } 
   value = value + gethorscroll(); 
   return value; 
 }
function getwinheight() { 
  var windowheight; 
  if (document.all) { 
    windowheight = top.document.body.clientHeight; 
  } else { 
    if (document.getElementById) { 
      windowheight = window.innerHeight; 
    } 
  } 
  return windowheight;   
 } 
 function getwinwidth() { 
  var windowheight; 
  if (document.all) { 
    windowheight = top.document.body.clientWidth; 
  } else { 
    if (document.getElementById) { 
      windowheight = window.innerWidth; 
    } 
  } 
  return windowheight;   
 } 
 function gethorscroll() { 
  var scrollvalue; 
  if (document.all) { 
    scrollvalue = top.document.body.scrollTop; 
  } else { 
    if (document.getElementById) { 
      scrollvalue = window.pageYOffset; 
    } 
  } 
  return scrollvalue; 
 } 
 function getverscroll() { 
  var scrollvalue; 
  if (document.all) { 
    scrollvalue = top.document.body.scrollLeft; 
  } else { 
    if (document.getElementById) { 
      scrollvalue = window.pageXOffset; 
    } 
  } 
  return scrollvalue; 
 } 
 function getscreenwidth() {
 	return screen.availWidth;
 }
 function getscreenheight() {
 	return screen.availHeight;
 }
