/**
*  Module
*
* Description
*/
angular.module('controllers', [])
.controller('welcomeCtrl', function ($scope,infoService){

infoService.homePoints().then(function(points){
	$scope.points=points;
})
infoService.carousel().then(function(Images){
	for(i=0;i<Images.length;i++){
		Images[i].image='assets/images/'+Images[i].image;
	}
	$scope.Images=Images;

});
//sidebar for mobile view
$scope.openSideMenu = function () {
	$('#sidemenu').sidebar({
	context:$('#mainpage')
}).sidebar('toggle');
}

//menu popups
	$('#aboutus').popup(
		{
    inline   : true,
    hoverable: true,
    position : 'bottom left',
    delay: {
      show: 300,
      hide: 600
    }
  
	})

	$('#education').popup(
		{
    inline   : true,
    hoverable: true,
    position : 'bottom right',
    delay: {
      show: 300,
      hide: 600
    }
  
	})

	$('#clients').popup(
		{
    inline   : true,
    hoverable: true,
    position : 'bottom right',
    delay: {
      show: 300,
      hide: 600
    }
  
	})



})
.controller('bizCtrl', function ($scope,infoService,$sce){
	infoService.business().then(function(companies){
		for (i=0;i<companies.length;i++){
					companies[i].description=$sce.trustAsHtml(companies[i].description);
				}
		$scope.companies=companies;
	})
})
.controller('eduCtrl',function ($scope,infoService,$sce){
infoService.wd_intermediate().then(function (outline){
	$scope.outline=outline;
})

infoService.wd_advanced().then(function (adv_outline){
	$scope.adv_outline=adv_outline;
})
infoService.infocommCourses().then(function (details){
	for (i=0;i<details.length;i++){
					details[i].description=$sce.trustAsHtml(details[i].description);
				}
	$scope.course_details=details;
})

})
.controller('clientsCtrl',function ($scope,infoService){
	infoService.sgComClients().then(function (clients){
		$scope.sgComClients=clients;
	});
	infoService.sgEduClients().then(function (clients){
		$scope.sgEduClients=clients;
	})
	infoService.myComClients().then(function (clients){
		$scope.myComClients=clients;
	})
	infoService.myEduClients().then(function (clients){
		$scope.myEduClients=clients;
	})
})
;