// Links to the 'Email Page'; The parameters include the Site Path (only for display) and the URL to this page
function emailpage(pagepath) {
 pageurl = "http://" + window.location.host + window.location.pathname;
 loadpage = "../../others/emailpage/index.php?pagepath="+pagepath+"&pageurl="+pageurl;
 window.location.href = loadpage;
}

function FensterOeffnen (Adresse) {
  Fenster1 = window.open(Adresse, "Imprint", "width=220,height=500,left=20,top=220");
  Fenster1.focus();
}


activeLayer = null;
timer = null;

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0 
  if (activeLayer != null) {window.clearTimeout(timer); MM_restore();}
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_restore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  dhtml_hide(a[0].name+'Layer');
  activeLayer = null;
}

function MM_over() { //v3.0 
  if (activeLayer != null) {window.clearTimeout(timer); MM_restore();}
  var i,j=0,x,a=MM_over.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
 dhtml_show(a[0]+'Layer'); 
 activeLayer = a[0];
}

function MM_out() {
  timer = setTimeout("MM_check();", 10);
}

function MM_dropdownOver() {
  window.clearTimeout(timer);
}

function MM_check() {
 if (activeLayer != null) 
   MM_restore();
 else 
   timer = setTimeout("MM_check();", 10);
}

/* Für den Teambereich BEGIN */

activeTeam = null;

function MM_teamover() { //v3.0 
  var i,j=0,x,a=MM_teamover.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_teamclick() { //v3.0 
  var a=MM_teamclick.arguments; 
  dhtml_hide('introLayer'); 
  dhtml_hide('schossLayer'); 
  dhtml_hide('neumarLayer');  
  dhtml_hide('chackoLayer');  
  dhtml_hide('stierlenLayer'); 
  dhtml_show(a[0]+'Layer'); 
  if (activeTeam != null) 
    document.getElementById(activeTeam).src = '../images/team/'+activeTeam+'.jpg';
  activeTeam = a[0];
}

function MM_teamout() {
  var a=MM_teamout.arguments;
  if (activeTeam != a[0]) MM_teamrestore();
}

function MM_teamrestore() { //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  //alert(document.MM_sr);
}

/* Für den Teambereich END */

/* Für den Portfolio BEGIN */

activePortfolio = null;


function MM_portfolioover() { //v3.0 
  var a=MM_portfolioover.arguments; 
  if (activePortfolio != a[0]) 
    document.getElementById('img_over').src = '../images/portfolio/img_'+a[0]+'.gif';
}

function MM_portfolioclick() { //v3.0 
  var a=MM_portfolioclick.arguments; 
  activePortfolio = a[0];
  if (activePortfolio != null) 
    document.getElementById('portfolioLayer').style.background='url(../images/portfolio/img_'+activePortfolio+'.gif)';
}

function MM_portfolioout() {
  var a=MM_portfolioout.arguments;
  if (activePortfolio != a[0]) 
      document.getElementById('img_over').src = '../images/pixel.gif';
  
}

/* Für den Portfolio END */
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



function getImageX ( image ) {
	// calculate horizontal position of an image
	var xPos = 0;
	if (document.layers) {
		xPos = image.x;
	}
	else {
		do {
			xPos += image.offsetLeft;
			image = image.offsetParent;
		} while ( image );
	}
	return xPos;
}

function getImageY ( image ) {
	// calculate vertical position of an image
	var yPos = 0;
	if (document.layers) {
		yPos = image.y;
	}
	else {
		do {
			yPos += image.offsetTop; 
			image = image.offsetParent;
		} while ( image );
	}
	return yPos;
}

function dhtml_support() {
  return (document.layers || 
          document.all || 
          document.getElementById)
}
function dhtml_obj(id) {
  if (document.layers)
    return document.layers[id];
  else if (document.all)
    return document.all[id];
  else if (document.getElementById)
    return document.getElementById(id);
}
function dhtml_style(id) {
  if (document.layers)
    return dhtml_obj(id);
  else if (document.layers || document.getElementById)
    return dhtml_obj(id).style;
}
function dhtml_hide(id) {
  if (dhtml_support())
    dhtml_style(id).visibility = "hidden";
}
function dhtml_show(id) {
  if (dhtml_support())
    dhtml_style(id).visibility = "visible";
}
function dhtml_getX(id) {
  if (dhtml_support())
    if (document.layers || document.getElementById)
      return dhtml_style(id).left;
    else
      return dhtml_style(id).posLeft;
}
function dhtml_getY(id) {
  if (dhtml_support())
    if (document.layers || document.getElementById)
      return dhtml_style(id).top;
    else
      return dhtml_style(id).posTop;
}
function dhtml_setX(id, n) {
  if (dhtml_support())
    if (document.layers) 
      dhtml_style(id).left = n;
    else if (document.getElementById)
      dhtml_style(id).left = n + "px";
    else
      dhtml_style(id).posLeft = n + "px";
}
function dhtml_setY(id, n) {
  if (dhtml_support())
    if (document.layers)
      dhtml_style(id).top = n;
    else if (document.getElementById)
      dhtml_style(id).top = n + "px";
    else
      dhtml_style(id).posTop = n + "px";
}
function dhtml_moveTo(id, x, y) {
  if (dhtml_support()) {
    dhtml_setX(id, x);
    dhtml_setY(id, y);
  }
}
function dhtml_moveBy(id, deltaX, deltaY) {
  if (dhtml_support()) {
    var x = parseInt(dhtml_getX(id));
    var y = parseInt(dhtml_getY(id));
    x += deltaX;
    y += deltaY;
    dhtml_setX(id, x);
    dhtml_setY(id, y);
  }
}
function dhtml_text(id, text) {
  if (dhtml_support())
    if (document.layers)
      with (document.layers[id].document) {
        open();
        write(text);
        close();
      }
    else
      dhtml_obj(id).innerHTML = text;
}
function dhtml_breite() {
  if (window.innerWidth)
    return window.innerWidth;
  else if (document.body)
    return document.body.clientWidth;
}
function dhtml_hoehe() {
  if (window.innerHeight)
    return window.innerHeight;
  else if (document.body)
    return document.body.clientHeight;
}
function dhtml_style_breite(id) {
  if (document.layers)
    return dhtml_obj(id).document.width;
  else if (document.all || document.getElementById)
    return dhtml_obj(id).offsetWidth;
}
function dhtml_style_hoehe(id) {
  if (document.layers)
    return dhtml_obj(id).document.height;
  else if (document.all || document.getElementById)
    return dhtml_obj(id).offsetHeight;
}

// SUBNAVIGATION END

function sendBottomForm(p) {
  document.bottomForm.doAction.value = p;
  document.bottomForm.submit();
}

function delete_user(id) {
	var check = confirm("Do you really want to delete your account?");
	if (check == true) {
		window.location.href="delete.php?id="+id;
	}
}

