orderPanels()

function orderPanels(){
	var divCalculator = document.getElementById('divCalculator');
	var divSupport = document.getElementById('divSupport');
	var divApplyTo = document.getElementById('divApplyTo');
	var divTop = document.getElementById('divTop');
	var divMain = document.getElementById('divMain');
	var divFooter = document.getElementById('divFooter');
	var divSteps = document.getElementById('divSteps');
	var divLoading = document.getElementById('divLoading');
	var divFintrac = document.getElementById('divFintrac');
	
	//Top
	divTop.style.top = 0;
	divTop.style.display = 'block';
	
	//Steps
	if(document.location.href.indexOf('/remittances/')!=-1){
	divSteps.style.top = divTop.clientHeight + 10;
	divSteps.style.left = 0;
	divSteps.style.display = 'block';}
	
	//FINTRAC
	if(document.location.href.indexOf('.asp')!=-1){
	divFintrac.style.top = (document.location.href.indexOf('/remittances/')!=-1)?(getCoordValue(divSteps.style.top)+(divSteps.clientHeight))+20:divTop.clientHeight + 10;
	divFintrac.style.left = (document.location.href.indexOf('/remittances/')!=-1)?30:643;
	divFintrac.style.display = 'block';
	divFintrac.style.visibility = 'hidden';
	}
	
	//Main
	divMain.style.display = 'block';
	divMain.className = 'Main_1';
	if(document.location.href.indexOf('.asp')==-1){divMain.style.top=82}else{divMain.style.top = divTop.clientHeight+5}
	if(document.location.href.indexOf('/remittances/')!=-1){
		divMain.className = 'Main';
		var c = getCoordValue(divFintrac.style.top)+(divFintrac.clientHeight);
		divMain.style.height = divMain.clientHeight>c?divMain.clientHeight:c; 	
		var m = divMain.clientHeight;
		divMain.style.height= (m>c)?m:(c-getCoordValue(divMain.style.top));
	}
	
	//Footer
	var m = getCoordValue(divMain.style.top)+(divMain.clientHeight);
	//var c = getCoordValue(divCalculator.style.top)+(divCalculator.clientHeight);
	var c = 110+(divCalculator.clientHeight);	
	if(m>c) {
		divFooter.style.top = m+7;
	}
	else {
		divFooter.style.top = c+7;
	}
	divFooter.style.display = 'block';
	divLoading.style.display = 'none';
	divCalculator.style.visibility='visible';
}
	
	function getCoordValue(x){
		return Number(x.substring(0,x.indexOf('px')))
	}