// Set-up

function start() {
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/Android/i))) {
touchScreen = 'yes';
$('.column-content-container').css({height: '499px'});
$('#clients-content').css({height: '470px'});
} else {
touchScreen = '';
columnScrollInterval = setInterval(columnScrollListener, 1);
}
section = '';
servicesSubSection = '';
clientsSubSection = '';
newsSubSection = '';
contactSubSection = '';
currentSection = '';
currentSectionHover = '';
mouseX = '';
mouseY = '';
printMouseFollow = 'false';
backMouseFollow = 'false';
columnCount = 0;
aboutTargetY = 0;
servicesTargetY = 0;
clientsTargetY = 0;
newsTargetY = 0;
contactTargetY = 0;
clientsLogosScrolling = '';
clientsLogosEnd = '';
if (document.referrer) {
var page = document.referrer;
} else {
page = 'none';
}
insertAnalytics('http://www.monolith-nyc.com/mammoth/insert_analytics.cfm?datasource=kcdworldwide&page=' + page + '&type=visit');
page = 'http://www.kcdworldwide.com/%23' + $.address.value();
page = page.replace(/&/g,'%26')
insertAnalytics('http://www.monolith-nyc.com/mammoth/insert_analytics.cfm?datasource=kcdworldwide&page=' + page + '&type=view');
$('.print, img#clients-logos').animate({opacity: 0.5}, 0);
$('img#logo').imagesLoaded(function() {
$(this).unbind('load')
.show()
.animate({opacity: 1.0}, {duration: 1000, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
$('#about a.column-title img').imagesLoaded(function() {
$(this).unbind('load');
$('#services a.column-title img').imagesLoaded(function() {
$(this).unbind('load');
$('#clients a.column-title img').imagesLoaded(function() {
$(this).unbind('load');
$('#news img.column-title').imagesLoaded(function() {
$(this).unbind('load');
$('#contact a.column-title img').imagesLoaded(function() {
$(this).unbind('load');
loadSection();
if (section != 'about') {
$('#about').animate({opacity: 1.0, height: '170px', top: '360px'}, {duration: 750, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
}
if (section != 'services') {
$('#services').animate({opacity: 1.0, height: '170px', top: '360px'}, {duration: 750, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
}
if (section != 'clients') {
$('#clients').animate({opacity: 1.0, height: '170px', top: '360px'}, {duration: 750, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
}
if (section != 'news') {
$('#news').animate({opacity: 1.0, height: '170px', top: '360px'}, {duration: 750, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
}
if (section != 'contact') {
$('#contact').animate({opacity: 1.0, height: '170px', top: '360px'}, {duration: 750, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
}
$('#columns-end-line').animate({opacity: 1.0, height: '170px', top: '360px'}, {duration: 750, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
});
});
});
});
});
$('#header').show()
.animate({opacity: 1.0}, {duration: 500, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
// Mouse events
$('.print').hover(function() {
startMouseFollow();
}, function() {
closeMouseFollow();
});
$('#about').click(function() {
if (section != 'about' && $('#about .column-content-container').is(':visible') == false && $('#about').is(':animated') == false) {
window.location = '#!/about';
}
});
$('#services').click(function() {
if (section != 'services' && $('#services .column-content-container').is(':visible') == false && $('#services').is(':animated') == false) {
window.location = '#!/services';
}
});
$('#clients').click(function() {
if (section != 'clients' && $('#clients .column-content-container').is(':visible') == false && $('#clients').is(':animated') == false) {
window.location = '#!/clients';
}
});
$('#news').click(function() {
if (section != 'news' && $('#news .column-content-container').is(':visible') == false && $('#news').is(':animated') == false) {
window.location = '#!/news/?sub=' + firstNewsItem;
}
});
$('#contact').click(function() {
if (section != 'contact' && $('#contact .column-content-container').is(':visible') == false && $('#contact').is(':animated') == false) {
window.location = '#!/contact';
}
});
$('a#services-title-69').hover(function() {
if (servicesSubSection != '69') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (servicesSubSection != '69') {
$(this).animate({backgroundPosition: '0px -14px'}, 0);
}
});
$('a#services-title-70').hover(function() {
if (servicesSubSection != '70') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (servicesSubSection != '70') {
$(this).animate({backgroundPosition: '0px -14px'}, 0);
}
});
$('a#services-title-71').hover(function() {
if (servicesSubSection != '71') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (servicesSubSection != '71') {
$(this).animate({backgroundPosition: '0px -14px'}, 0);
}
});
$('a#services-title-72').hover(function() {
if (servicesSubSection != '72') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (servicesSubSection != '72') {
$(this).animate({backgroundPosition: '0px -14px'}, 0);
}
});
$('a#services-title-93').hover(function() {
if (servicesSubSection != '93') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (servicesSubSection != '93') {
$(this).animate({backgroundPosition: '0px -14px'}, 0);
}
});
$('a#kcd-twitter').hover(function() {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}, function() {
$(this).animate({backgroundPosition: '0px -14px'}, 0);
});
$('a#contact-title-73').hover(function() {
if (contactSubSection != '73') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (contactSubSection != '73') {
$(this).animate({backgroundPosition: '0px -14px'}, 0);
}
});
$('a#contact-title-74').hover(function() {
if (contactSubSection != '74') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (contactSubSection != '74') {
$(this).animate({backgroundPosition: '0px -14px'}, 0);
}
});
$('a#clients-sub-nav-button-link').hover(function() {
$('#clients-sub-nav-by-category').animate({backgroundPosition: '0px 0px'}, 0);
}, function() {
$('#clients-sub-nav-by-category').animate({backgroundPosition: '0px -12px'}, 0);
});
$('a#clients-title-pr').hover(function() {
if (clientsSubSection != '75' && clientsSubSection != '76' && clientsSubSection != '77' && clientsSubSection != '78') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '75' && clientsSubSection != '76' && clientsSubSection != '77' && clientsSubSection != '78') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-75').hover(function() {
if (clientsSubSection != '75') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '75') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-76').hover(function() {
if (clientsSubSection != '76') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '76') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-77').hover(function() {
if (clientsSubSection != '77') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '77') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-78').hover(function() {
if (clientsSubSection != '78') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '78') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-production').hover(function() {
if (clientsSubSection != '79' && clientsSubSection != '80' && clientsSubSection != '81') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '79' && clientsSubSection != '80' && clientsSubSection != '81') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-79').hover(function() {
if (clientsSubSection != '79') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '79') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-80').hover(function() {
if (clientsSubSection != '80') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '80') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-81').hover(function() {
if (clientsSubSection != '81') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '81') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-90').hover(function() {
if (clientsSubSection != '90') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '90') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$('a#clients-title-91').hover(function() {
if (clientsSubSection != '91') {
$(this).animate({backgroundPosition: '0px 0px'}, 0);
}
}, function() {
if (clientsSubSection != '91') {
$(this).animate({backgroundPosition: '0px -12px'}, 0);
}
});
$(document).mousemove(function(e) {
mouseX = e.pageX;
mouseY = e.pageY;
if (printMouseFollow = 'true') {
$('#print-follower').css({top: (e.pageY + 10) + 'px', left: (e.pageX + 10) + 'px'});
}
if (backMouseFollow = 'true') {
$('#back-follower').css({top: (e.pageY + 10) + 'px', left: (e.pageX + 10) + 'px'});
}
});
// Events
$.address.change(function(event) {  
address();
});
}
});
});
}

function columnScrollListener() {
if (currentSection && currentSection != currentSectionHover && mouseX >= $('#' + currentSection).offset().left && mouseX < Math.round($('#' + currentSection).offset().left + 183)) {
if (currentSectionHover) {
$('#' + currentSectionHover + ' .column-content .content-text').stop()
.animate({color: '#999'}, {duration: 500, easing: 'jswing'});
$('#' + currentSectionHover + ' .column-content .content-text .print').stop()
.animate({opacity: 0.5}, {duration: 500, easing: 'jswing'});
if (currentSectionHover == 'clients') {
$('img#clients-logos').stop()
.animate({opacity: 0.5}, {duration: 500, easing: 'jswing'});
}
}
$('#' + currentSection + ' .column-content .content-text').stop()
.animate({color: '#FFF'}, {duration: 500, easing: 'jswing'});
$('#' + currentSection + ' .column-content .content-text .print').stop()
.animate({opacity: 1.0}, {duration: 500, easing: 'jswing'});
if (currentSection == 'clients') {
$('img#clients-logos').stop()
.animate({opacity: 1.0}, {duration: 500, easing: 'jswing'});
}
currentSectionHover = currentSection;
} else if (currentSection && currentSectionHover && currentSectionHover == currentSection && mouseX < $('#' + currentSection).offset().left || currentSection && currentSectionHover && currentSectionHover == currentSection && mouseX >= Math.round($('#' + currentSection).offset().left + 183)) {
$('#' + currentSectionHover + ' .column-content .content-text').stop()
.animate({color: '#999'}, {duration: 500, easing: 'jswing'});
$('#' + currentSectionHover + ' .column-content .content-text .print').stop()
.animate({opacity: 0.5}, {duration: 500, easing: 'jswing'});
if (currentSectionHover == 'clients') {
$('img#clients-logos').stop()
.animate({opacity: 0.5}, {duration: 500, easing: 'jswing'});
}
currentSectionHover = '';
}
if (currentSection && $('#' + currentSection + ' .column-content-container').height() < $('#' + currentSection + ' .column-content').height() && mouseX >= $('#' + currentSection).offset().left && mouseX < Math.round($('#' + currentSection).offset().left + 183) && $('#pop-up').is(':visible') == false && mouseY < ($('#' + currentSection + ' .column-content-container').offset().top + 125) && $('#clients-sub-nav').is(':visible') == false) {
if (currentSection == 'clients' && clientsLogosScrolling == 'true') {
clientsTargetY = $('#clients .column-content').offset().top - $('#clients .column-content-container').offset().top;
clientsLogosScrolling = '';
}
if (window[currentSection + 'TargetY'] < 0) {
window[currentSection + 'TargetY']++;
}
$('#' + currentSection + ' .column-content').stop()
.animate({top: window[currentSection + 'TargetY'] + 'px'}, {duration: 0, queue: false});
} else if (currentSection && $('#' + currentSection + ' .column-content-container').height() < $('#' + currentSection + ' .column-content').height() && mouseX >= $('#' + currentSection).offset().left && mouseX < Math.round($('#' + currentSection).offset().left + 183) && $('#pop-up').is(':visible') == false && mouseY >= Math.round($('#' + currentSection).offset().top + 405) && $('#clients-sub-nav').is(':visible') == false) {
if (currentSection == 'clients' && clientsLogosScrolling == 'true') {
clientsTargetY = $('#clients .column-content').offset().top - $('#clients .column-content-container').offset().top;
clientsLogosScrolling = '';
}
if (window[currentSection + 'TargetY'] >= Math.round(0 - ($('#' + currentSection + ' .column-content').height() - $('#' + currentSection + ' .column-content-container').height()))) {
window[currentSection + 'TargetY']--;
}
$('#' + currentSection + ' .column-content').stop()
.animate({top: window[currentSection + 'TargetY'] + 'px'}, {duration: 0, queue: false});
} else if (! clientsLogosScrolling && ! clientsLogosEnd && $('img#clients-logos').is(':visible') == true && $('#clients .column-content').is(':animated') == false && $('#clients-sub-nav').is(':visible') == false) {
var targetY = Math.round(0 - ($('#clients .column-content').height() - $('#clients .column-content-container').height()));
var i = $('#clients .column-content').offset().top - $('#clients .column-content-container').offset().top;
i = Math.round(60000 + (i * 45));
clientsLogosScrolling = 'true';
$('#clients .column-content').stop()
.animate({top: targetY}, {duration: i, complete:function() {
clientsTargetY = $('#clients .column-content').offset().top - $('#clients .column-content-container').offset().top;
clientsLogosScrolling = '';
clientsLogosEnd = 'true';
}
});
}
}

function deactivateLink(i) {
$(i).bind('click.deactivateLink', function(event) {
event.preventDefault();
})
.css({cursor: 'default'});
}

function activateLink(i) {
$(i).unbind('.deactivateLink')
.css({cursor: 'pointer'});
}

function loadPopUp(i) {
$('#pop-up-content').load('blog.cfm?postid=' + i, function() {
if (newsSubSection) {
$('#pop-up').stop()
.animate({opacity: 0.0}, 0)
.show()
.animate({opacity: 1.0}, {duration: 750, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
}
});
}

function startClosePopUp() {
window.location='#!/news';
}

function closePopUp() {
$('#pop-up').hide();
$('#pop-up-content').empty();
$('a#news-title-' + newsSubSection).removeClass('blog-post-title')
activateLink('a#news-title-' + newsSubSection);
newsSubSection = '';
}

function deactivateLink(i) {
$(i).bind('click.deactivateLink', function(event) {
event.preventDefault();
})
.css({cursor: 'default'});
}

function startMouseFollow() {
printMouseFollow = 'true';
$('#print-follower').show();
}

function closeMouseFollow() {
$('#print-follower').hide();
printMouseFollow = 'false';
}

function startBackMouseFollow() {
backMouseFollow = 'true';
$('#back-follower').show();
}

function closeBackMouseFollow() {
$('#back-follower').hide();
backMouseFollow = 'false';
}

function insertAnalytics(x) {
if ('withCredentials' in new XMLHttpRequest()) {
$.post(x);
}
}

// Clients

function loadClientsSubNav() {
$('#clients-sub-nav-button-link').hide();
$('#clients-sub-nav').show();
$('#clients-content').css({height: '323px'});
$('#clients .column-content').stop();
subNavInterval = setInterval(subNavListener, 100);
}

function subNavListener() {
var i = $('#clients-sub-nav').offset().left;
var j = $('#clients-sub-nav').offset().top;
var k = $('#clients-sub-nav').width() + 5;
var l = $('#clients-sub-nav').height() + 5;
if(mouseX && mouseX < i || mouseX && mouseX >= i + k || mouseY && mouseY < j || mouseY && mouseY >= j + l) {
closeSubNav();
}
}

function closeSubNav() {
$(window).unbind('mousemove');
mouseX = '';
mouseY = '';
$('#clients-sub-nav-button-link').show();
$('#clients-sub-nav').hide();
$('#clients-content').css({height: '470px'});
if ($('#clients .column-content').height() < $('#clients .column-content-container').height()) {
$('#clients .column-content').stop()
.animate({top: '0px'}, 0);
}
clearInterval(subNavInterval);
subNavInterval = null;
}

// Address

function address() {
var page = 'http://www.kcdworldwide.com/%23' + $.address.value();
page = page.replace(/&/g,'%26')
insertAnalytics('http://www.monolith-nyc.com/mammoth/insert_analytics.cfm?datasource=kcdworldwide&page=' + page + '&type=view');
loadSection();
}

function subSectionClick(i,j,k) {
if ($('#' + j + '-' + k).is(':visible') == true) {
$('a#' + j + '-title-' + window[j + 'SubSection']).stop()
.animate({backgroundPosition: '0px -14px'}, 0);
window[j + 'SubSection'] = k;
if ($.address.value() == '/' + j) {
loadSection();
} else {
window.location = '#!/' + j;
}
} else if ($.address.value() == '/' + j + '/?sub=' + k) {
window[j + 'SubSection'] = k;
loadSection();
} else {
window.location = i;
}
}

function loadSection() {
if (window.subNavInterval) {
closeSubNav();
}
if (window.blogScrollInterval) {
clearInterval(blogScrollInterval);
blogScrollInterval = null;
}
var i = $.address.value();
var j = '';
var k = '';
if ($.address.parameter('sub')) {
i = i.substr(0, i.indexOf('/?sub'));
j = $.address.value().replace(i + '/', '');
i = i.replace('/', '');
k = $.address.parameter('sub');
} else {
i = $.address.value().replace('/', '');
}
if (i != 'news' && $('#pop-up').is(':visible') == true || i == 'news' && ! j && $('#pop-up').is(':visible') == true) {
closePopUp();
}
if (section != i && $('#' + i + ' .column-content-container').is(':visible') == false && $('#' + i).is(':animated') == false) {
columnCount++;
if (columnCount == 5) {
$('#columns-end-line').stop()
.animate({height: '530px', top: '0px'}, {duration: 750, easing: 'jswing'});
}
window[i + 'TargetY'] = 0;
currentSection = i;
$('#' + i).stop()
.animate({opacity: 1.0, height: '530px', top: '0px'}, {duration: 750, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
if (k) {
if (i == 'news') {
$('a#news-title-' + k).addClass('blog-post-title');
deactivateLink('a#news-title-' + k);
newsSubSection = k;
loadPopUp(k);
} else {
if (i == 'clients') {
if ($.address.parameter('sub') == '75') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_ny.png)'});
} else if ($.address.parameter('sub') == '76') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_paris.png)'});
} else if ($.address.parameter('sub') == '77') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_shows.png)'});
} else if ($.address.parameter('sub') == '78') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_events.png)'});
} else if ($.address.parameter('sub') == '79') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_production_shows.png)'});
} else if ($.address.parameter('sub') == '80') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_production_events.png)'});
} else if ($.address.parameter('sub') == '81') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_production_castings.png)'});
} else if ($.address.parameter('sub') == '90') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_digital.png)'});
} else if ($.address.parameter('sub') == '91') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_consulting.png)'});
} else {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_by_category.png)'});
}
$('img#clients-logos').hide();
if (k == '75' || k == '76' || k == '77' || k == '78') {
$('a#clients-title-pr').stop()
.animate({backgroundPosition: '0px 0px'}, 0);
deactivateLink('a#clients-title-pr');
} else if (k == '79' || k == '80' || k == '81') {
$('a#clients-title-production').stop()
.animate({backgroundPosition: '0px 0px'}, 0);
deactivateLink('a#clients-title-production');
}
}
$('a#' + i + '-title-' + k).stop()
.animate({backgroundPosition: '0px 0px'}, 0);
if (i != 'services' && i != 'contact') {
deactivateLink('a#' + i + '-title-' + k);
}
$('#' + i + '-' + k).stop()
.show();
window[i + 'SubSection'] = k;
}
}
$('#' + i + ' .column-content').stop()
.animate({top: '0px'}, 0);
if (i == 'clients') {
$('a#clients-sub-nav-button-link').show();
$('#clients-sub-nav-button').stop()
.animate({opacity: 0.0}, 0)
.show()
.animate({opacity: 1.0}, {duration: 500, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
}
$('#' + i + ' .column-content-container').stop()
.animate({opacity: 0.0}, 0)
.show()
.animate({opacity: 1.0}, {duration: 500, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
if (touchScreen == 'yes') {
$('#' + i + ' .column-content-container').jScrollTouch();
if (i == 'clients' && ! clientsSubSection) {
var targetY = Math.round($('#clients .column-content').height() - $('#clients .column-content-container').height());
$('#' + i + ' .column-content-container').animate({scrollTop: targetY}, {duration: 60000});
}
} else {
$(this).mousemove(function(e) {
if (currentSection != i) {
scrollOffset = 0;
if (currentSection) {
$('#' + currentSection + ' .column-content .content-text').stop()
.animate({color: '#999'}, {duration: 500, easing: 'jswing'});
}
$('#' + i + ' .column-content .content-text').stop()
.animate({color: '#FFF'}, {duration: 500, easing: 'jswing'});
currentSection = i;
}
});
}
}
});
}
});
activateLink('#' + i + ' a.column-title');
} else if (i) {
if (i == 'clients' && $('img#clients-logos').is(':visible') == true) {
$('img#clients-logos').hide();
} else if (i == 'clients' && ! k && $('img#clients-logos').is(':visible') == false) {
$('img#clients-logos').stop()
.animate({opacity: 0.0}, 0)
.show()
.animate({opacity: 1.0}, {duration: 500, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
}
if (window[i + 'SubSection']) {
if (i == 'news') {
$('a#news-title-' + newsSubSection).removeClass('blog-post-title')
activateLink('a#news-title-' + newsSubSection);
newsSubSection = '';
} else {
if (i == 'clients') {
var l = '12';
} else {
l = '14';
}
if (i == 'clients') {
if ($.address.parameter('sub') == '75') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_ny.png)'});
} else if ($.address.parameter('sub') == '76') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_paris.png)'});
} else if ($.address.parameter('sub') == '77') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_shows.png)'});
} else if ($.address.parameter('sub') == '78') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_events.png)'});
} else if ($.address.parameter('sub') == '79') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_production_shows.png)'});
} else if ($.address.parameter('sub') == '80') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_production_events.png)'});
} else if ($.address.parameter('sub') == '81') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_production_castings.png)'});
} else if ($.address.parameter('sub') == '90') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_digital.png)'});
} else if ($.address.parameter('sub') == '91') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_consulting.png)'});
} else {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_by_category.png)'});
}
if (window[i + 'SubSection'] == '75' || window[i + 'SubSection'] == '76' || window[i + 'SubSection'] == '77' || window[i + 'SubSection'] == '78') {
$('a#clients-title-pr').stop()
.animate({backgroundPosition: '0px -12px'}, 0);
activateLink('a#clients-title-pr');
} else if (window[i + 'SubSection'] == '79' || window[i + 'SubSection'] == '80' || window[i + 'SubSection'] == '81') {
$('a#clients-title-production').stop()
.animate({backgroundPosition: '0px -12px'}, 0);
activateLink('a#clients-title-production');
}
}
$('a#' + i + '-title-' + window[i + 'SubSection']).stop()
.animate({backgroundPosition: '0px -' + l + 'px'}, 0);
if (!k && window[i + 'SubSection'] || i != 'services' && i != 'contact') {
activateLink('a#' + i + '-title-' + window[i + 'SubSection']);
$('#' + i + '-' + window[i + 'SubSection']).hide();
if ($('#' + i + ' .column-content-container').height() >= $('#' + i + ' .column-content').height()) {
$('#' + i + ' .column-content').stop()
.animate({top: '0px'}, 0);
window[currentSection + 'TargetY'] = 0;
}
}
window[i + 'SubSection'] = '';
}
}
if (k) {
if (i == 'news') {
$('a#news-title-' + k).addClass('blog-post-title')
deactivateLink('a#news-title-' + k);
if ($('#pop-up').is(':visible') == true) {
$('#pop-up-content').load('blog.cfm?postid=' + k);
} else {
loadPopUp(k);
}
newsSubSection = k;
} else {
if (i != 'services' && i != 'contact') {
$('#' + i + ' .column-content').stop()
.animate({top: '0px'}, 0);
}
if (i == 'clients') {
if ($.address.parameter('sub') == '75') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_ny.png)'});
} else if ($.address.parameter('sub') == '76') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_paris.png)'});
} else if ($.address.parameter('sub') == '77') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_shows.png)'});
} else if ($.address.parameter('sub') == '78') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_pr_events.png)'});
} else if ($.address.parameter('sub') == '79') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_production_shows.png)'});
} else if ($.address.parameter('sub') == '80') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_production_events.png)'});
} else if ($.address.parameter('sub') == '81') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_production_castings.png)'});
} else if ($.address.parameter('sub') == '90') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_digital.png)'});
} else if ($.address.parameter('sub') == '91') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_consulting.png)'});
} else {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_by_category.png)'});
}
if (k == '75' || k == '76' || k == '77' || k == '78') {
$('a#clients-title-pr').stop()
.animate({backgroundPosition: '0px 0px'}, 0);
deactivateLink('a#clients-title-pr');
} else if (k == '79' || k == '80' || k == '81') {
$('a#clients-title-production').stop()
.animate({backgroundPosition: '0px 0px'}, 0);
deactivateLink('a#clients-title-production');
}
}
$('a#' + i + '-title-' + k).stop()
.animate({backgroundPosition: '0px 0px'}, 0);
if (i != 'services' && i != 'contact') {
deactivateLink('a#' + i + '-title-' + k);
}
if (i == 'clients') {
$('#' + i + '-' + k).stop()
.animate({opacity: 0.0}, 0)
.show()
.animate({opacity: 1.0}, {duration: 500, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
} else {
if (k == '72' && $('#' + i + '-' + k).is(':visible') == false || k == '74' && $('#' + i + '-' + k).is(':visible') == false) {
$('#' + i + '-' + k).stop()
.animate({opacity: 0.0}, 0)
.show()
.animate({opacity: 1.0}, {duration: 500, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
} else if ($('#' + i + '-' + k).is(':visible') == false) {
$('#' + i + '-' + k + '-bg').stop()
.animate({height: '0px'}, 0)
.show()
.animate({height: window['subSection' + k + 'Height'] + 'px'}, {duration: 500, easing: 'jswing', complete:function() {
$(this).hide();
if (window[i + 'SubSection'] == k) {
$('#' + i + '-' + k).stop()
.animate({opacity: 0.0}, 0)
.show()
.animate({opacity: 1.0}, {duration: 500, easing: 'jswing', complete:function() {
if ($.browser.msie) {
this.style.removeAttribute('filter');
}
}
});
}
}
});
} else {
$('a#' + i + '-title-' + k).stop()
.animate({backgroundPosition: '0px -14px'}, 0);
$('#' + i + '-' + k).hide();
if ($('#' + i + ' .column-content-container').height() >= $('#' + i + ' .column-content').height()) {
$('#' + i + ' .column-content').stop()
.animate({top: '0px'}, 0);
}
var m = 'true';
}
}
if (! m) {
window[i + 'SubSection'] = k;
}
}
}
}
section = i;
}

function closeColumn(i) {
$('#' + i + ' .column-content-container').stop()
.hide();
if (i == 'clients') {
clientsLogosEnd = '';
$('a#clients-sub-nav-button-link').hide();
$('img#clients-logos').show();
}
if (! touchScreen) {
$('#' + i + ' .column-content-container').unbind('mousemove');
}
if (columnCount == 5) {
$('#columns-end-line').stop()
.animate({height: '170px', top: '360px'}, {duration: 500, easing: 'jswing'});
}
columnCount--;
$('#' + i).stop()
.animate({height: '170px', top: '360px'}, {duration: 500, easing: 'jswing'});
if (window[i + 'SubSection'] || i == 'services' || i == 'contact') {
if (i == 'clients') {
j = '12';
} else {
j = '14';
}
if (i == 'clients') {
$('#clients-sub-nav-by-category').css({backgroundImage: 'url(content/img/clients_sub_nav_by_category.png)'});
if (window[i + 'SubSection'] == '75' || window[i + 'SubSection'] == '76' || window[i + 'SubSection'] == '77' || window[i + 'SubSection'] == '78') {
$('a#clients-title-pr').stop()
.animate({backgroundPosition: '0px -12px'}, 0);
activateLink('a#clients-title-pr');
} else if (window[i + 'SubSection'] == '79' || window[i + 'SubSection'] == '80' || window[i + 'SubSection'] == '81') {
$('a#clients-title-production').stop()
.animate({backgroundPosition: '0px -12px'}, 0);
activateLink('a#clients-title-production');
}
}
if (i == 'services') {
$('#' + i + '-69').hide();
$('#' + i + '-70').hide();
$('#' + i + '-71').hide();
$('#' + i + '-72').hide();
$('#' + i + '-93').hide();
} else if (i == 'contact') {
$('#' + i + '-73').hide();
$('#' + i + '-74').hide();
}
if (window[i + 'SubSection']) {
$('a#' + i + '-title-' + window[i + 'SubSection']).stop()
.animate({backgroundPosition: '0px -' + j + 'px'}, 0);
}
if (i != 'services' && i != 'contact') {
activateLink('a#' + i + '-title-' + window[i + 'SubSection']);
$('#' + i + '-' + window[i + 'SubSection']).hide();
}
window[i + 'SubSection'] = '';
}
deactivateLink('#' + i + ' a.column-title');
window.location = '#!';
section = '';
}

