function openWin(site,frameName,width,height,resz,scrlb)
{  
    var y = (Math.round((screen.availHeight-height)/2))
    var x = (Math.round((screen.availWidth-width)/2))

showWin = open(site,frameName,"width="+width+",height="+height+",top="+y+",left="+x+",scrollbars="+scrlb+",status=0,resizable="+resz+",location=0,menubar=0,toolbar=0,fullscreen=0");
	
  showWin.focus();

}

function mail2Recipient(toUser, toDomain){
user = toUser;
domain = toDomain;
document.write('<a class=\"contNav\" href=\"mailto:' + user + '@' + domain + '\">');
document.write(user + '@' + domain + '</a><br>');
}


function checkMail()
{
  var checked=true;
  var pattern=/.*\@.*\..*/;
       
                    if (checked)
          {
            if (document.contact.name.value=="")
        {
                  document.contact.name.focus();
                  document.contact.name.select();
          alert ("Bitte füllen Sie das Pflichtfeld *Name* aus.");
          checked=false;
        }
          }
			 
       
		                      if (checked)
          {
            if ((pattern.test(document.contact.email.value))==false)
        {
                  document.contact.email.focus();
                  document.contact.email.select();
          alert ("Bitte geben Sie eine gültige E-Mail-Adresse ein.");
          checked=false;
        }
          }

      	             if (checked)
          {
            if (document.contact.nachricht.value=="")
        {
                  document.contact.nachricht.focus();
                  document.contact.nachricht.select();
          alert ("Bitte füllen Sie das Pflichtfeld *Nachricht* aus.");
          checked=false;
        }
          }
        
  return checked;
} //endFunctinCheck

function switchContainer(item)
{
    var cnt = 1;
    for(var i = 1; i < 5; i++)
    {
        var container = document.getElementById('item'+i)
        if(i == item)
        {
            container.style.top = 0;
        }
        else
        {
            container.style.top = (250*cnt)+'px';
            cnt++;
        }
    }
}
function impeller(trigger)
{
    var parentDiv = trigger.parentNode;
    var contentContainer = parentDiv.getElementsByTagName('div')[0];
    
    var contentDivs = contentContainer.getElementsByTagName('div');
    
    var hidden = 0;
    
    for(var i = 0; i< contentDivs.length; i++)
    {
        if(contentDivs[i].style.display == 'none')
        {
            hidden++;
        }
    }
    for(var i = 0; i< contentDivs.length; i++)
    {
        if(i < hidden +2)
        {
            contentDivs[i].style.display = 'none';
        }
        if (hidden == contentDivs.length-2)
        {
            contentDivs[i].style.display = '';
        }
    }
    
}

function swap(img,imgURL)
{
document.images[img].src = imgURL;
}
