/*****Anfahrtskizze**********************************************/
var ZZ = 0;

function anfahrtD() {

	var fen = window.open(
		'asd.html','Anfahrt', 'width=642,height=620,status=no,resizable=no,top=40,left=40,dependent=yes,alwaysRaised=yes'
	);
	fen.opener = window;
	fen.focus();
}

/*****Screenshot**********************************************/

var ZZ = 0;


function screenshot(x) {

	

	var fen2 = window.open(
		'screenshots.html','Screenshot', 'width=800,height=600,status=no,resizable=no,top=40,left=40,dependent=yes,alwaysRaised=yes'
	);

fen2.document.write ("<html><head><title>Screenshot P&P Software und Consulting GmbH</title></head>");




fen2.document.write ("<body style=\"background-image:url(./images/screenshots/" +x+ "); background-repeat:no-repeat;\"></body></html>");


	fen2.opener = window;
         fen2.focus();

fen2.document.close ();
}

/*****Screenshot_nodecoration**********************************************/

function screenshot_nodecoration(x) {

	

	var fen2 = window.open(
		'screenshots.html','Screenshot', 'width=800,height=544,status=no,resizable=no,top=40,left=40,dependent=yes,alwaysRaised=yes'
	);

fen2.document.write ("<html><head><title>Screenshot P&P Software und Consulting GmbH</title></head>");




fen2.document.write ("<body style=\"background-image:url(./images/screenshots/" +x+ "); background-repeat:no-repeat;\"></body></html>");


	fen2.opener = window;
         fen2.focus();

fen2.document.close ();
}

/*****Lesezeichen**********************************************/
function addBookmark()
         {
		bookmarkurl=self.location.href;
		bookmarktitle=document.title;
                 if(document.all)
                 window.external.AddFavorite(bookmarkurl,bookmarktitle);
                 else  alert("Zum Speichern als Lesezeichen: STRG + D dr%FCcken");
 }
/*****Kontaktformular**********************************************/
function clearfield(x) {
if(document.getElementById(x).value == "Pflichtfeld" || document.getElementById(x).value == "Ihre Nachricht an uns.")
document.getElementById(x).value = "";
}

function resetForm() {
for (var i=0; i<10; i++) {
   document.eform.elements[i].style.backgroundColor = "#FFFFFF"; }
   return true;
}

function chkFormular()
{
if(document.eform.anrede.options[document.eform.anrede.selectedIndex].value == "") {
   document.eform.anrede.style.backgroundColor = "#FF9595";
   alert(unescape("Bitte Anrede ausw%E4hlen%21"));
   document.eform.anrede.focus();
   return false;
  }
else
document.eform.anrede.style.backgroundColor = "#FFFFFF";

if(document.eform.name.value == "" || document.eform.name.value == "Pflichtfeld") {
   document.eform.name.style.backgroundColor = "#FF9595";
   alert(unescape("Bitte geben Sie Ihren Namen ein%21"));
   document.eform.name.focus();
   return false;
  }
else
document.eform.name.style.backgroundColor = "#FFFFFF";

if(document.eform.firma.value == "" || document.eform.firma.value == "Pflichtfeld") {
   alert(unescape("Bitte geben Sie einen Firmen- oder Organisationsnamen ein%21"));
   document.eform.firma.style.backgroundColor = "#FF9595";
   document.eform.firma.focus();
   return false;
  }
else
document.eform.firma.style.backgroundColor = "#FFFFFF";

 if(document.eform.email.value == "" || document.eform.email.value == "Pflichtfeld") {
   document.eform.email.style.backgroundColor = "#FF9595";
   alert(unescape("Bitte geben Sie Ihre E-Mail-Adresse ein%21"));
   document.eform.email.focus();
   return false;
  }
else
document.eform.email.style.backgroundColor = "#FFFFFF";

 if(EMail(document.eform.email.value) == false) {
   document.eform.email.style.backgroundColor = "#FF9595";
   alert(unescape("Bitte geben Sie eine g%FCltige E-Mail-Adresse ein%21"));
   document.eform.email.focus();
   return false;
 }
else
document.eform.email.style.backgroundColor = "#FFFFFF";

 if(document.eform.nachricht.value == "" || document.eform.nachricht.value == "Ihre Nachricht an uns.") {
   document.eform.nachricht.style.backgroundColor = "#FF9595";
   alert(unescape("Bitte geben Sie eine Nachricht ein%21"));
   document.eform.nachricht.focus();
   return false;
  }
else
document.eform.nachricht.style.backgroundColor = "#FFFFFF";
}

function EMail(s)
{
 var a = false;
 var res = false;
 if(typeof(RegExp) == 'function')
 {
  var b = new RegExp('abc');
  if(b.test('abc') == true){a = true;}
  }

 if(a == true)
 {
  reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
  res = (reg.test(s));
 }
 else
 {
  res = (s.search('@') >= 1 &&
         s.lastIndexOf('.') > s.search('@') &&
         s.lastIndexOf('.') >= s.length-5)
 }
 return(res);
}


/*********Submenu******************************************/
function submenu(x) {
var y;
y = x;
if(y < 0)
y = y * -1;
y =  "ddm"+y;

if(x>=0) {
document.getElementById(y).style.zIndex = "1000";
document.getElementById(y).style.display = "block";
}
else {
document.getElementById(y).style.zIndex = "-1";
document.getElementById(y).style.display = "none";


/*********Hauptmenu************muss ans Ende wegen IE******************************/
sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {

		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";

		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}

	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

}
}



/*********Mitarbeiterbild******************************************/
 var bildarray = new Array("bacher", "berger", "dinges", "diwinski", "glaser", "hartmann", "jendritza-schepp", "kuhnert", "kalugin", "kraft", "lehmann", "lueck", "daniel_pregler", "pregler", "schneider", "stiegel", "eishold", "herbert_vorhauer", "leopold", "mattenberger", "irina_gorlova", "wellacher");

function mabon(x) {


var y;
y =  "mab"+x;
z = "mbg";
ZZ = x;
var links =    absLeft(document.getElementById(y));
var oben =     absTop(document.getElementById(y));

document.getElementById('mbgi').src = "images/mitarbeiter/" + bildarray[x-1] + ".jpg";
document.getElementById(z).style.zIndex = "1000";
document.getElementById(z).style.display = "block";
document.getElementById(z).style.left = (links -93) +"px";
document.getElementById(z).style.top = (oben -110) +"px";
}


function maboff(x) {
ZZ = x;
z = "mbg";
document.getElementById(z).style.zIndex = "-1";
document.getElementById(z).style.display = "none";
}


  function absLeft(el) {
     return (el.offsetParent)?
     el.offsetLeft+absLeft(el.offsetParent) : el.offsetLeft;
  }

   function absTop(el) {
     return (el.offsetParent)?
     el.offsetTop+absTop(el.offsetParent) : el.offsetTop;
  }
