function DoBewerben(jobid, fid, newlocation )
{
	if(window.opener==null)
	{
			location.href = newlocation;
	}
	else
	{
	   try{
		if(typeof(window.opener.Bewerbung)!='undefined')
		{
			window.opener.Bewerbung(jobid);
			window.close();
		}
		else
		{
			location.href = newlocation;
		}
	      }
	  catch (e){
		var breite=screen.width-2;
		var hoehe=screen.height;
		self.resizeTo(breite,hoehe);
		self.moveTo(0,0);

	  	location.href = newlocation;
	  }
	}
}


function Bewerbung(jobid)
{
	document.forms[0].aktion.value = jobid;
	document.forms[0].submit();
}

// Schliessen des Browsers
function CloseWindow()
{
	window.close();
}
      
function setIframeHeight(iframeName,nHeight) 
{
	var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
	if (iframeEl) 
	{
		iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
		// need to add to height to be sure it will all show
		var h = alertSize();
		var hf = nHeight;	
		var new_h = (h-hf);
		iframeEl.style.height = new_h + "px";
		window.status=hf;
  }
}

function alertSize() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Height = ' + myHeight );
  return myHeight;
}

function FooterHeight()
{
	var trFooter = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
	var footerHeight=	trFooter.style.height;
	return footerHeight;
}

function resizeCaller()
{
   	setIframeHeight('iStellenanzeige',70);
   	setIframeHeight('iMainFrame',0);
}


if (window.addEventListener)
{
	window.addEventListener("load", resizeCaller, false)
	window.addEventListener("resize", resizeCaller, false)
}
else if (window.attachEvent)
{
	window.attachEvent("onload", resizeCaller)
	window.attachEvent("onresize", resizeCaller)
}
else
{
	window.onload=resizeCaller;
	window.onresize=resizeCaller;
}


