// JavaScript Document

$(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready
 // (a little sooner than page load)

$('#advertisingBox').hide();
$('#mediaInvestmentManagementBox').hide();
$('#informationInsightConsultancyBox').hide();
$('#publicRelationsPublicAffairsBox').hide();
$('#brandingIdentityBox').hide();
$('#healthcareCommunicationsBox').hide();
$('#directDigitalPromotionRelationshipMarketingBox').hide();
$('#specialistCommunicationsBox').hide();
$('#wppDigitalBox').hide();
$('#wppDigitalPartnerCompaniesBox').hide();
$('#wppKnowledgeCommunitiesBox').hide();


$.slideUp = function(){
	$('#advertisingBox').slideUp(400);
	$('#mediaInvestmentManagementBox').slideUp(400);
	$('#informationInsightConsultancyBox').slideUp(400);
	$('#publicRelationsPublicAffairsBox').slideUp(400);
	$('#brandingIdentityBox').slideUp(400);
	$('#healthcareCommunicationsBox').slideUp(400);
	$('#directDigitalPromotionRelationshipMarketingBox').slideUp(400);
	$('#specialistCommunicationsBox').slideUp(400);
	$('#wppDigitalBox').slideUp(400);
	$('#wppDigitalPartnerCompaniesBox').slideUp(400);
	$('#wppKnowledgeCommunitiesBox').slideUp(400);
	
	
};


$.textOpen = function(){
	$("a#advertise-toggle").text("Open");	
	$("a#mediaInvestmentManagement-toggle").text("Open");	
	$("a#informationInsightConsultancy-toggle").text("Open");	
	$("a#publicRelationsPublicAffairs-toggle").text("Open");	
	$("a#brandingIdentity-toggle").text("Open");	
	$("a#healthcareCommunications-toggle").text("Open");	
	$("a#directDigitalPromotionRelationshipMarketing-toggle").text("Open");
	$("a#specialistCommunications-toggle").text("Open");
	$("a#wppDigital-toggle").text("Open");
	$("a#wppDigitalPartnerCompanies-toggle").text("Open");	
	$("a#wppKnowledgeCommunities-toggle").text("Open");
};

$.imageOpen = function(){
	$("a#advertise-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#mediaInvestmentManagement-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#informationInsightConsultancy-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#publicRelationsPublicAffairs-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#brandingIdentity-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#healthcareCommunications-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#directDigitalPromotionRelationshipMarketing-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#specialistCommunications-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#wppDigital-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#wppDigitalPartnerCompanies-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	$("a#wppKnowledgeCommunities-toggle").css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
};




  
 // toggles the slickbox on clicking the noted link
  $('a#advertise-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#advertisingBox').slideToggle(400);
	return false;	
  });  





  $('a#mediaInvestmentManagement-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#mediaInvestmentManagementBox').slideToggle(400);
	return false;	
  });  




  $('a#informationInsightConsultancy-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#informationInsightConsultancyBox').slideToggle(400);
	return false;	
  });  



  $('a#publicRelationsPublicAffairs-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#publicRelationsPublicAffairsBox').slideToggle(400);
	return false;	
  });  



  $('a#brandingIdentity-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#brandingIdentityBox').slideToggle(400);
	return false;	
  });  





  $('a#healthcareCommunications-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#healthcareCommunicationsBox').slideToggle(400);
	return false;	
  });  




  $('a#directDigitalPromotionRelationshipMarketing-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#directDigitalPromotionRelationshipMarketingBox').slideToggle(400);
	return false;	
  });  




  $('a#specialistCommunications-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#specialistCommunicationsBox').slideToggle(400);
	return false;	
  });  





  $('a#wppDigital-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#wppDigitalBox').slideToggle(400);
	return false;	
  });  




  $('a#wppDigitalPartnerCompanies-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#wppDigitalPartnerCompaniesBox').slideToggle(400);
	return false;	
  });  





  $('a#wppKnowledgeCommunities-toggle').click(function() {
	switch ($(this).text()){
		case "Open":
		$.textOpen();
		$.imageOpen();
		$(this).text("Close");
		$.slideUp();
		$(this).css({ background:"url(../images/who_we_are/closeArrow.gif) no-repeat right"});
		break;
		default:
		$(this).text("Open");	
		$(this).css({ background:"url(../images/who_we_are/openArrow.gif) no-repeat right"});
	}
	$('#wppKnowledgeCommunitiesBox').slideToggle(400);
	return false;	
  });  



});