
function openpopup(url,width,height) 
{
	if (width != "" && height != "") {
		win1 = window.open(url, "_new_","width="+width+",height="+height+",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=no");
	} else if (width != "")  {
		win1 = window.open(url, "_new_","width="+width+",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=no");
	} else if (height != "")  {
		win1 = window.open(url, "_new_","height="+height+",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=no");
	} else {
		win1 = window.open(url,"toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=no");
	}
	win1.focus();
	return false;
}

function openwindow(url,width,height) 
{
	if (width != "" && height != "") {
		win1 = window.open(url, "_new_","width="+width+",height="+height+",toolbar=yes,directories=yes,statusbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,dependent=yes");
	} else if (width != "")  {
		win1 = window.open(url, "_new_","width="+width+",toolbar=yes,directories=yes,statusbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,dependent=yes");
	} else if (height != "")  {
		win1 = window.open(url, "_new_","height="+height+",toolbar=yes,directories=yes,statusbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,dependent=yes");
	} else {
		win1 = window.open(url,"_new_","toolbar=yes,directories=yes,statusbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,dependent=yes");
	}
	win1.focus();
	return false;
}

function closewindow()
{
	self.close();
}

function openSiteInOpener(url) {
	opener.location.href=url;
	self.close();
}

function CheckAndSubmit() {
	var frm = document.contactform;
	if (frm.Name.value == '') {
		alert('Bitte füllen Sie das Feld Name aus!');
		frm.Name.focus();
		return false;
	} else if (frm.EmailAdresse.value=='') {
		alert('Bitte füllen Sie das Feld E-mail Adresse aus!');
		frm.EmailAdresse.focus();
		return false;
	} else {
		return true;
	}
}

function getQueryParameter(key) {
  var querystring = window.location.search
  var returnstring ="";
  if (querystring.indexOf("?") == 0) {
    querystring = querystring.substring(1, querystring.length);
  }
  pairs = querystring.split("&");
  for (i=0;i<pairs.length;i++) {
    keys = pairs[i].split("=");
    if (keys[0] == key ) {
      returnstring = keys[1].replace(/\+/, " ");
      break;
    }
  }
  return returnstring;
}
