// JavaScript Document

// kontaktformular

function checkform(form){

  if (form.nachname.value == "") {
    alert( "Bitte geben Sie Ihren Namen an." );
    form.nachname.style.border='1px solid red';
    form.nachname.focus();
    return false ;
  }


  if (form.email.value == "") {
    alert( "Bitte geben Sie Ihre E-Mail Adresse an." );
    form.email.style.border='1px solid red';
    form.email.focus();
    return false ;
  }

  if (form.text.value == "") {
    alert( "Vergessen Sie nicht eine Nachricht einzugeben." );
    form.text.style.border='1px solid red';
    form.text.focus();
    return false ;
  }

  return true ;

}

function checkENform(form){

  if (form.nachname.value == "") {
    alert( "Name is required." );
    form.nachname.style.border='1px solid red';
    form.nachname.focus();
    return false ;
  }


  if (form.email.value == "") {
    alert( "E-Mail is required." );
    form.email.style.border='1px solid red';
    form.email.focus();
    return false ;
  }

  if (form.text.value == "") {
    alert( "Message is required." );
    form.text.style.border='1px solid red';
    form.text.focus();
    return false ;
  }

  return true ;

}

function navDeactivateSingle(node) {
  if(node.getElementsByTagName('img')[0])
    node.getElementsByTagName('img')[0].src="/images/brownArrow.gif";
}

function navActivateSingle(node){
  if(node.getElementsByTagName('img')[0])
    node.getElementsByTagName('img')[0].src="/images/whiteArrow2.gif";
} 

function navDeactivate(node) {
  if(node.getElementsByTagName('img')[0])
    node.getElementsByTagName('img')[0].src="/images/brownArrow.gif";
}

function navActivate(node){
  if(node.getElementsByTagName('img')[0])
    node.getElementsByTagName('img')[0].src="/images/whiteArrow.gif";
} 



function browserWindowSize() {
var browserWinWidth = 0, browserWinHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
browserWinWidth = window.innerWidth;
browserWinHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
browserWinWidth = document.documentElement.clientWidth;
browserWinHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
browserWinWidth = document.body.clientWidth;
browserWinHeight = document.body.clientHeight;
}
a = new Array();
a[0] = browserWinWidth;
a[1] = browserWinHeight;

return a;
}

function repositioning(){

  size = browserWindowSize();
  if(size[1]<630){
    document.getElementById('container').style.top='0%';
    document.getElementById('container').style.marginTop='15px'; 
    document.getElementById('container').style.marginBottom='15px';   
  }
}

window.onResize = window.setTimeout('repositioning()', 100);