function openPopup(URL,WIDTH,HEIGHT){
	if(!WIDTH) WIDTH=600;
	if(!HEIGHT) HEIGHT=600;
	popup = window.open(URL,"popup","width="+WIDTH+", height="+HEIGHT+", scrollbars=yes");
}

function sitemap(URL){
	WIDTH=600;
	HEIGHT=600;
	popup = window.open(URL,"popup","width="+WIDTH+", height="+HEIGHT+", scrollbars=yes");
	popup.focus();
}


/////////////////////////////////////////////
// Dynamic Tabs controller used in VI3 pages
//

function showLayer(lyr) {
   makeHistory(lyr);
   document.getElementById(currentLayer).className = 'hide';
   document.getElementById(lyr).className = 'show';
   currentLayer = lyr;
   showTab(lyr.replace("tab","t_"));
}

function showTab(lyr) {
   document.getElementById(currentTab).className = 'taboff';
   document.getElementById(lyr).className = 'tabon';
   currentTab = lyr;
}

function makeHistory(newHash) {
  window.location.hash = "_" + newHash;
  expectedHash = window.location.hash;
  return true;
}

function handleHistory() {
  if ( window.location.hash != expectedHash ) {
    expectedHash = window.location.hash;
    if (expectedHash.match('tab')) showLayer(expectedHash.substring(2));
  }
  return true;
}

function pollHash() {
  handleHistory();
  window.setInterval("handleHistory()", 200);
  return true;
}
////////// END Dynamic Tabs /////////


function changelanguage ()
{
	alert("here")
}

/// landingpages formchecks  ///
function checkEmail(myForm) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(f.email.value)) {
		return true;
	}
}
function checkCode(myForm) {
	if (/[0-9]{5}/.test(f.code.value)) {
		return true;
	}
}
function checkform(){
	f = document.kontaktformular;
	f.vorname.style.border = "1px solid #7E85A0";
	f.nachname.style.border = "1px solid #7E85A0";
	f.email.style.border = "1px solid #7E85A0";
	f.code.style.border = "none";
	if ((f.vorname.value == "") || (f.nachname.value == "") || (checkEmail(f) != true) || (checkCode(f) != true)) {
		if (checkCode(f) != true) {
			f.code.focus();
			f.code.style.border = "1px solid #FF9900";
		}
		if (checkEmail(f) != true){
			f.email.focus();
			f.email.style.border = "1px solid #FF9900";
	    }
		if (f.nachname.value == "") {
			f.nachname.focus();
			f.nachname.style.border = "1px solid #FF9900";
		}
		if (f.vorname.value == "") {
			f.vorname.focus();
			f.vorname.style.border = "1px solid #FF9900";
		}
	return false;
	}
	else {
		return true;
	}
}
function submitform(){
	f = document.kontaktformular;
	if (checkform() == true){
		f.submit();
	}
}
