

function showCourse(url) {
	course = window.open("/wetrok/"+url,"etcoursecontent","scrollbars=yes,dependent=yes,status=no,resizable=yes,toolbar=no,menubar=no,height="+screen.availHeight+",width="+screen.availWidth+",left=0,top=0");
	course.focus();
	course.resizeTo(1020,720);
	return course;
}	

	
	function fn_getPassword() {
			popup = window.open("/wetrok/l/pwReminder","pwReminder","scrollbars=auto,dependent=yes,statusbar=no,resizable=no,menubar=no,height=200,width=300,left=400,top=200");
			popup.focus();
	}
	
	function fn_changeInputBackgroundOnEnter(inputObj, imagePrefix) {
		inputObj.style.backgroundImage="url('/wetrok/images/"+imagePrefix+".gif')";
	}

	
	function fn_changeInputBackgroundOnExit(inputObj, imagePrefix) {
		if (inputObj.value.length==0) {
			inputObj.style.backgroundImage="url('/wetrok/images/"+imagePrefix+".gif')";
		}
	}

function fn_openMmLite(url) {
	mmLite = window.open("/wetrok/"+url,"mmLite","scrollbars=yes,dependent=yes,status=no,resizable=yes,toolbar=no,menubar=no,height="+screen.availHeight+",width="+screen.availWidth+",left=0,top=0");
	mmLite.focus();
	mmLite.resizeTo(screen.availWidth, screen.availHeight);
	return mmLite;
}	

function fn_openMm() {
	mmLite = window.open("/wetrok/u/teamleader/mm","mm","scrollbars=yes,dependent=yes,status=no,resizable=yes,toolbar=no,menubar=no,height="+screen.availHeight+",width="+screen.availWidth+",left=0,top=0");
	mmLite.focus();
	mmLite.resizeTo(screen.availWidth, screen.availHeight);
	return mmLite;
}	

function fn_callReport(reportId){
	winPref = window.open("/wetrok/share/report/ReportServlet?reportId=" + reportId + "&action=init","reportFilterMenue","width=1000,height=710,scrollbars=no,dependent=yes,resizable=yes,left=0,top=0,menubar=no");
	winPref.focus();
	return winPref;
}

function fn_editQualifications(userId){ 
	quali = window.open("/wetrok/u/teamleaderEditQualification?employeeId=" + userId ,"editQualification", "width=600,height=400,scrollbars=no,dependent=yes,resizable=no,left=0,top=0,menubar=no");
	quali.focus();
	return quali;
}

function fn_editRequirement(assignmentId){ 
	requi = window.open("/wetrok/u/teamleader/requirement/wizard?doAction=editAssignmentRequest&assignmentId=" + assignmentId ,"editRequirement", "width=screen.availWidth,height=screen.availHeight,scrollbars=yes,dependent=yes,resizable=yes,left=0,top=0,menubar=no");
	requi.focus();
	requi.resizeTo(screen.availWidth, screen.availHeight);
	return requi;
}

function fn_editEducationRequest(eduReqId){ 
	eduReq = window.open("/wetrok/u/teamleader/requirement/wizard?doAction=editEducationRequest&educationRequestId=" + eduReqId ,"editEducationRequest", "width=screen.availWidth,height=screen.availHeight,scrollbars=yes,dependent=yes,resizable=yes,left=0,top=0,menubar=no");
	eduReq.focus();
	eduReq.resizeTo(screen.availWidth, screen.availHeight);
	return eduReq;
}

function fn_fillAssessment(assigId, assessId, userId){
	fillAss = window.open("/wetrok/c/assessment/showAssessment?assignmentId=" + assigId + "&assessmentId=" + assessId + "&userId=" + userId + "&action=fillOutTeamleader", "fillOutTeamleader", "width=screen.availWidth,height=screen.availHeight,scrollbars=yes,dependent=yes,resizable=yes,left=0,top=0,menubar=no");
	fillAss.focus();
	fillAss.resizeTo(screen.availWidth, screen.availHeight);
	return fillAss;
}

function fn_newRequirement(){
	newReq = window.open("/wetrok/u/teamleader/requirement/wizard?doAction=new", "requirement", "width=screen.availWidth,height=screen.availHeight,scrollbars=yes,dependent=yes,resizable=yes,left=0,top=0,menubar=no");
	newReq.focus();
	newReq.resizeTo(screen.availWidth, screen.availHeight);
	return newReq;
}

function fn_showAchievements(userId){ 
	achiev = window.open("/wetrok/u3/achievementsPopup.jsf?userId=" + userId ,"userAchievements", "width=screen.availWidth,height=screen.availHeight,scrollbars=yes,dependent=yes,resizable=yes,left=0,top=0,menubar=no");
	achiev.focus();
	achiev.resizeTo(screen.availWidth, screen.availHeight);
	return achiev;
}

function fn_openCertificateTeamview(){ 
	certTeam = window.open("/wetrok/u/teamleader/certificate/newTeamview" ,"certifcate", "width=screen.availWidth,height=screen.availHeight,scrollbars=yes,dependent=yes,resizable=yes,left=0,top=0,menubar=no");
	certTeam.focus();
	certTeam.resizeTo(screen.availWidth, screen.availHeight);
	return certTeam;
}

function fn_openCertificateProductview(){ 
	certProd = window.open("/wetrok/u/teamleader/certificate/newOverview?action=init","certifcate", "width=screen.availWidth,height=screen.availHeight,scrollbars=yes,dependent=yes,resizable=yes,left=0,top=0,menubar=no");
	certProd.focus();
	certProd.resizeTo(screen.availWidth, screen.availHeight);
	return certProd;
}

function fn_showDiploma(){
	preview = window.open("/wetrok/c/diploma/showDiploma?action=userPreview&subAction=init&nextPage=diploma","showDiploma", "width=1020,height=710,scrollbars=yes,dependent=yes,resizable=no,left=0,top=0,menubar=no");
	preview.focus();
	return preview;
}

function fn_chooseDiploma(){
	diplomaChooser=window.open("/wetrok/share/objectBrowser3Controller?ob3id=62002&sendSelectedObjectsTo=employeeOverview&sendSelectedObjectsUseCase=diploma","targetName","scrollbars=yes,status=no,dependent=yes,resizable=no,menubar=no,height=710,width=1000,left=0,top=0");
	diplomaChooser.focus();
	return diplomaChooser;
}

function fn_exportDiploma(objectId, language){
	exportDiploma = window.open("/wetrok/c/diploma/exportDiploma?objectId=" + objectId + "&language=" + language);
	exportDiploma.focus();
	return exportDiploma;
}

function fn_grayOut() {
	var zindex = 50;
	var opacity = 70;
	var opaque = (opacity / 100);
	var bgcolor = '#000000';
	var dark = document.getElementById('darkenScreenObject');
	if (!dark) {
	  var tbody = document.getElementsByTagName("body")[0];
	  var tnode = document.createElement('div');			// Create the layer.
	      tnode.style.position = 'absolute';				// Position absolutely
	      tnode.style.top = '0px';							// In the top
	      tnode.style.left = '0px';							// Left corner of the page
	      tnode.style.overflow = 'hidden';					// Try to avoid making scroll bars            
	      tnode.style.display = 'none';						// Start out Hidden
	      tnode.id = 'darkenScreenObject';					// Name it so we can find it later
	  tbody.appendChild(tnode);								// Add it to the web page
	  dark = document.getElementById('darkenScreenObject');	// Get the object.
	}
	
	var pageWidth = fn_Fensterweite() + 'px';
	var pageHeight = fn_Fensterhoehe() + 'px';
	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		pageWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		pageWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		pageWidth = document.body.clientWidth;
	}
	
	dark.style.opacity = opaque;                      
	dark.style.MozOpacity = opaque;                   
	dark.style.filter = 'alpha(opacity = ' + opacity + ')'; 
	dark.style.zIndex = zindex;        
	dark.style.backgroundColor = bgcolor;  
	dark.style.width = pageWidth;
	dark.style.height = pageHeight;
	dark.style.display = 'block';                          
}

function fn_Fensterweite() {
	if (window.innerWidth) {
	    return window.innerWidth;
	} else if (document.body && document.body.offsetWidth) {
		return document.body.offsetWidth;
	} else {
		return 0;
	}
}

function fn_Fensterhoehe() {
	if (window.innerHeight) {
    	return window.innerHeight + 4;
	} else if (document.body && document.body.offsetHeight) {
    	return document.body.offsetHeight;
 	} else if(document.documentElement && document.documentElement.clientHeight){
    	return document.documentElement.clientHeight;
  	} else {
		return 420;
  	}
}

