function OpenWindow(theURL,winName,winCenter,x,y,features) {
  var param = "width=" + x + ",height=" + y + ( features=="" ? "" : "," + features );
  var win = window.open(theURL,winName,param);
  if (theURL.indexOf('http://') == -1) {
    if (winCenter) win.moveTo((screen.width-x)/2,(screen.height-y)/2);
    win.focus(); 
  }}


function showWin(z_url) {
			   OpenWindow(z_url , 'popupwin' , 1 , 500 , 400 , 'resizable=yes,scrollbars=yes')
			  }

function popupWin(z_url) 	  {if (GetCookie('VM_COOKIE')!='been there')
			   {
  			    OpenWindow(z_url , 'popupwin' , 1 , 700 , 500 , 'resizable=yes,scrollbars=yes')
			    SetCookie('VM_COOKIE','been there')
			   }
			  }
			  
			  

//  Cookie-Funktionen
function getCookieVal(offset){
var endstr=window.document.cookie.indexOf(";", offset);
if (endstr==-1)
    endstr=window.document.cookie.length;
  return unescape(window.document.cookie.substring(offset, endstr));
}

function GetCookie(name){
var arg = name + "=";
var alen = arg.length;
var clen = window.document.cookie.length;
var i = 0;
while (i < clen){
    var j = i + alen;
    if (window.document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = window.document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;}
  return null;
}

function SetCookie (name,value){
window.document.cookie = name + "=" + escape (value) + "; path=/";
}
