function createSlaCalculationOverlay()
{
	var pageOverLayDiv = new Element('div', {'class': 'pageOverLay', 'id':'pageOverLay'}).injectInside('wrapper'); 
    var pageOverLayDivNo = new Element('div', {'class': 'pageOverLayNoOpacity', 'id':'pageOverLayNoOpacity'}).injectInside('wrapper'); 
	var dialogOverView = new Element('div', {'class': 'dialogOverViewLargeImage'}).injectInside(pageOverLayDivNo);	
   
    var dialogDiv = new Element('div', {'class': 'dialogMap overlay', 'id': 'dialogMap'}).injectInside(dialogOverView);
    var dialogContentDiv = new Element('div', {'class': 'spContent', 'id': 'spContent', 'style':'float: left;'}).injectInside(dialogDiv);
    
	var menuDiv = new Element('div', {'id': 'menuDiv'}).injectInside(dialogContentDiv);
	var emptyDiv = new Element('div', {'id': 'dummyDiv'}).setText(' ').injectInside(menuDiv);
	var dialogBottomClose = new Element('div', {'id': 'closeDiv', 'class':'closeDiv'}).setText(' ').injectInside(menuDiv);
	
	$('closeDiv').addEvent('click', function(){
		$("pageOverLayNoOpacity").remove();
		$("pageOverLay").remove();
	});

	var dialogTopDiv = new Element('div', {'class': 'top', 'id': 't'}).injectInside(dialogContentDiv);
    var dialogText = new Element('div', {'id':'text'}).injectAfter(dialogTopDiv);

        var dialogHeader = new Element('h4', {'id': 'textH4'}).injectInside(dialogText);
    	var dialogBody = new Element('div', {'id': 'textP'});
		var data = getForm();
		dialogBody.innerHTML = '';
        dialogBody.injectInside(dialogText).injectAfter(dialogHeader);
	var dialogPartnerContent = new Element('div', {'id':'partnerContent'});
	dialogPartnerContent.injectAfter(dialogBody);
	
	var dialogFloatKill = new Element('div', {'class': 'clearBoth'}).injectAfter(dialogPartnerContent);
    var dialogBottomDiv = new Element('div', {'class': 'bottom', 'id': 'b','style': 'float: left;'}).injectInside(dialogDiv);
    var dialogEmptyDiv = new Element('div').injectInside(dialogBottomDiv);
	var dialogFloatKill2 = new Element('div', {'class': 'clearBoth'}).injectAfter(dialogBottomDiv);
}

function getForm()
{
	doAjaxCall('/custom/sla/slaForm.htm', 'textP');
}

function doAjaxCall(requestPage, updateContainer)
{
	new Ajax(requestPage,
		{
			method:'get', 
			update:updateContainer, 
			evalScripts: true
		}
	).request();

	return false;	
}

function Calculate()
{
	var WorkStations = $("NumberOfWorkStations").value;
	var MobileWorkStations = $("NumberOfMobileWorkStations").value;
	var Servers = $("NumberOfServers").value;
	var Investment = $("IctInvestment").value;
	
	var url = '/custom/sla/berekening.php?wp='+WorkStations+'&mwp='+MobileWorkStations+'&ser='+Servers+'&inv='+Investment;
	doAjaxCall(url, 'textP');
}

function CalculateOverhead(totalPlaces)
{
	var ictManagment = $("ictManagment").value;
	var workspaceCost = $("workspaceCost").value;	
	var lanCost = $("lanCost").value;
	var wanCost = $("wanCost").value;
	var appCost = $("appCost").value;
	var speakCost = $("speakCost").value;
	
	var url = '/custom/sla/overheadCalculation.php?imc='+ictManagment+'&wsc='+workspaceCost+'&lc='+lanCost+'&wc='+wanCost+'&ac='+appCost+'&sc='+speakCost+'&tp='+totalPlaces;
	doAjaxCall(url, 'overheadCalculation');
}