/* ################## Functions ################################# */

/* Check object is present function to prevent nulls */
function chkObject(theVal) {
if (document.getElementById(theVal) != null) {
return true;
} else {
return false;
}
}

/* hide the display of an object function */
function hideObject(obj) {
	var el = document.getElementById(obj);
		el.style.display = 'none';
	}

/* display an object function */
function showObject(obj) {
	var el = document.getElementById(obj);
		el.style.display = 'block';
	}

/* set the class of link to faded function */
function fadeObject(obj) {
	var el = document.getElementById(obj);
		el.className = "solution-faded";
	}

/* set the class of link to non faded function */
function nonFadeObject(obj) {
	var el = document.getElementById(obj);
		el.className = "";
	}
/* ################## END Functions ################################# */


	
/* ################## CUSTOMERS  ################################# */
function filterCustomers(){
/* swap banner images */
// hiding
if (chkObject('home-banner-default') == true) {
		hideObject('home-banner-default');
}
if (chkObject('home-banner-channel') == true) {
		hideObject('home-banner-channel');
}
if (chkObject('home-banner-employee') == true) {
		hideObject('home-banner-employee');
}
// showing
if (chkObject('home-banner-customer') == true) {
		showObject('home-banner-customer');
}
/* Hide non Customer based links */
if (chkObject('DiversityAwarenessTraining') == true) {
		fadeObject('DiversityAwarenessTraining');
}
if (chkObject('CustomerServiceTraining') == true) {
		fadeObject('CustomerServiceTraining');
}
if (chkObject('OrganisationalBehaviourChange') == true) {
		fadeObject('OrganisationalBehaviourChange');
}
if (chkObject('MysteryShopping') == true) {
		fadeObject('MysteryShopping');
}
if (chkObject('EmployeeSatisfactionSurveys') == true) {
		fadeObject('EmployeeSatisfactionSurveys');
}
if (chkObject('TaxEfficientBenefits') == true) {
		fadeObject('TaxEfficientBenefits');
}
if (chkObject('TotalRewardStatements') == true) {
		fadeObject('TotalRewardStatements');
}
if (chkObject('Recognition') == true) {
		fadeObject('Recognition');
}
/* Show all other links */
if (chkObject('CustomerandChannelLoyalty') == true) {
		nonFadeObject('CustomerandChannelLoyalty');
}
if (chkObject('SearchEngineMarketing') == true) {
		nonFadeObject('SearchEngineMarketing');
}
if (chkObject('CustomerSatisfactionSurveys') == true) {
		nonFadeObject('CustomerSatisfactionSurveys');
}
if (chkObject('CustomerLoyaltyProgrammes') == true) {
		nonFadeObject('CustomerLoyaltyProgrammes');
}
if (chkObject('DataAnalytics') == true) {
		nonFadeObject('DataAnalytics');
}
/* Change the copy div */
/* hiding */
if (chkObject('home-copy-default') == true) {
		hideObject('home-copy-default');
}
if (chkObject('home-copy-channel') == true) {
		hideObject('home-copy-channel');
}
if (chkObject('home-copy-employee') == true) {
		hideObject('home-copy-employee');
}
// showing
if (chkObject('home-copy-customer') == true) {
		showObject('home-copy-customer');
}
// change the icon to active
if (chkObject('solutions-customers-image') == true) {
		document.getElementById("solutions-customers-image").style.backgroundImage = "url(/gruk-theme/images/color_schemes/gruk/customers-icon-on.gif)";
}
if (chkObject('solutions-employees-image') == true) {
		document.getElementById("solutions-employees-image").style.backgroundImage = "url(/gruk-theme/images/color_schemes/gruk/employee-icon.gif)";
}
if (chkObject('solutions-partners-image') == true) {
		document.getElementById("solutions-partners-image").style.backgroundImage = "url(/gruk-theme/images/color_schemes/gruk/partner-icon.gif)";
}
}


/* ################## EMPLOYEES  ################################# */
function filterEmployees(){
/* swap banner images */
// hiding
if (chkObject('home-banner-default') == true) {
		hideObject('home-banner-default');
}
if (chkObject('home-banner-channel') == true) {
		hideObject('home-banner-channel');
}
if (chkObject('home-banner-customer') == true) {
		hideObject('home-banner-customer');
}
// showing
if (chkObject('home-banner-employee') == true) {
		showObject('home-banner-employee');
}

/* Hide non Employee based links */
if (chkObject('DiversityAwarenessTraining') == true) {
		fadeObject('DiversityAwarenessTraining');
}
if (chkObject('SearchEngineMarketing') == true) {
		fadeObject('SearchEngineMarketing');
}
if (chkObject('CustomerSatisfactionSurveys') == true) {
		fadeObject('CustomerSatisfactionSurveys');
}
if (chkObject('CustomerLoyaltyProgrammes') == true) {
		fadeObject('CustomerLoyaltyProgrammes');
}
if (chkObject('CustomerandChannelLoyalty') == true) {
		fadeObject('CustomerandChannelLoyalty');
}
if (chkObject('DataAnalytics') == true) {
		fadeObject('DataAnalytics');
}

/* Show all other links */
if (chkObject('DiversityAwarenessTraining') == true) {
		nonFadeObject('DiversityAwarenessTraining');
}
if (chkObject('CustomerServiceTraining') == true) {
		nonFadeObject('CustomerServiceTraining');
}
if (chkObject('OrganisationalBehaviourChange') == true) {
		nonFadeObject('OrganisationalBehaviourChange');
}
if (chkObject('MysteryShopping') == true) {
		nonFadeObject('MysteryShopping');
}
if (chkObject('EmployeeSatisfactionSurveys') == true) {
		nonFadeObject('EmployeeSatisfactionSurveys');
}
if (chkObject('TaxEfficientBenefits') == true) {
		nonFadeObject('TaxEfficientBenefits');
}
if (chkObject('TotalRewardStatements') == true) {
		nonFadeObject('TotalRewardStatements');
}
if (chkObject('Recognition') == true) {
		nonFadeObject('Recognition');
}

/* Change the copy div */
/* hiding */
if (chkObject('home-copy-default') == true) {
		hideObject('home-copy-default');
}
if (chkObject('home-copy-channel') == true) {
		hideObject('home-copy-channel');
}
if (chkObject('home-copy-customer') == true) {
		hideObject('home-copy-customer');
}
// showing
if (chkObject('home-copy-employee') == true) {
		showObject('home-copy-employee');
}
// change the icon to active
if (chkObject('solutions-employees-image') == true) {
		document.getElementById("solutions-employees-image").style.backgroundImage = "url(/gruk-theme/images/color_schemes/gruk/employee-icon-on.gif)";
}
if (chkObject('solutions-customers-image') == true) {
		document.getElementById("solutions-customers-image").style.backgroundImage = "url(/gruk-theme/images/color_schemes/gruk/customers-icon.gif)";
}
if (chkObject('solutions-partners-image') == true) {
		document.getElementById("solutions-partners-image").style.backgroundImage = "url(/gruk-theme/images/color_schemes/gruk/partner-icon.gif)";
}
}

/* All operations when the Channel link is clicked */
function filterChannel(){
/* swap banner images */
// hiding
if (chkObject('home-banner-default') == true) {
		hideObject('home-banner-default');
}
if (chkObject('home-banner-employee') == true) {
		hideObject('home-banner-employee');
}
if (chkObject('home-banner-customer') == true) {
		hideObject('home-banner-customer');
}

// showing
if (chkObject('home-banner-channel') == true) {
		showObject('home-banner-channel');
}

/* Hide non Channel based links */
if (chkObject('CustomerSatisfactionSurveys') == true) {
		fadeObject('CustomerSatisfactionSurveys');
}
if (chkObject('TaxEfficientBenefits') == true) {
		fadeObject('TaxEfficientBenefits');
}
if (chkObject('TotalRewardStatements') == true) {
		fadeObject('TotalRewardStatements');
}
if (chkObject('CustomerLoyaltyProgrammes') == true) {
		fadeObject('CustomerLoyaltyProgrammes');
}

/* Show all other links */
if (chkObject('SearchEngineMarketing') == true) {
		nonFadeObject('SearchEngineMarketing');
}
if (chkObject('DiversityAwarenessTraining') == true) {
		nonFadeObject('DiversityAwarenessTraining');
}
if (chkObject('CustomerserviceTraining') == true) {
		nonFadeObject('CustomerserviceTraining');
}
if (chkObject('OrganisationalBehaviourChange') == true) {
		nonFadeObject('OrganisationalBehaviourChange');
}
if (chkObject('MysteryShopping') == true) {
		nonFadeObject('MysteryShopping');
}
if (chkObject('EmployeeSatisfactionSurveys') == true) {
		nonFadeObject('EmployeeSatisfactionSurveys');
}
if (chkObject('ChannelLoyaltyProgrammes') == true) {
		nonFadeObject('ChannelLoyaltyProgrammes');
}
if (chkObject('DataAnalytics') == true) {
		nonFadeObject('DataAnalytics');
}
if (chkObject('Recognition') == true) {
		nonFadeObject('Recognition');
}

/* Change the copy div */
/* hiding */
if (chkObject('home-copy-default') == true) {
		hideObject('home-copy-default');
}
if (chkObject('home-copy-employee') == true) {
		hideObject('home-copy-employee');
}
if (chkObject('home-copy-customer') == true) {
		hideObject('home-copy-customer');
}
// showing
if (chkObject('home-copy-channel') == true) {
		showObject('home-copy-channel');
}
// change the icon to active
if (chkObject('solutions-employees-image') == true) {
		document.getElementById("solutions-employees-image").style.backgroundImage = "url(/gruk-theme/images/color_schemes/gruk/employee-icon.gif)";
}
if (chkObject('solutions-customers-image') == true) {
		document.getElementById("solutions-customers-image").style.backgroundImage = "url(/gruk-theme/images/color_schemes/gruk/customers-icon.gif)";
}
if (chkObject('solutions-partners-image') == true) {
		document.getElementById("solutions-partners-image").style.backgroundImage = "url(/gruk-theme/images/color_schemes/gruk/partner-icon-on.gif)";
}
}
