function cookiebasedredirect() {
?>
<script type="text/javascript">
jQuery(document).on(\'click\', \'#organisation\', function(event){
event.preventDefault();
jQuery.cookie("site_changer", "organisation", { expires: 1 });
window.location.href = window.location.href;
});
jQuery(document).on(\'click\', \'#young-professional\', function(event){
event.preventDefault();
jQuery.cookie("site_changer", "young-professional", { expires: 1 });
window.location.href = window.location.href;
});
</script>
<?php
}
add_action("wp_head", "cookiebasedredirect");