if(typeof qerD == "undefined") {qerD = {};} if(typeof qerFunc == "undefined") {qerFunc = {};} qerFunc.initTT = function() {qerFunc.ellipseWords('.ttParent .tt .ttContent .ttContentText, .ttParent .tt .ttContent .ttContentHeadline', 16); var currentTT = null; var currentTTColorPool = ['ttRed']; var currentTTColor = currentTTColorPool[Math.ceil(Math.random() * currentTTColorPool.length - 1)]; $('.ttParent img').bind('mouseover', function(e) {if(currentTT != null) {$(currentTT).remove();} currentTT = $(this).parents('.ttParent').find('.tt').clone(); $('body').append(currentTT); $(currentTT).addClass(currentTTColor); $(currentTT).css({display: 'block', zIndex: '1000', position: 'absolute', left: e.pageX + 10, top: e.pageY - 40});}); $('.ttParent img').bind('mousemove', function(e) {if(currentTT != null) {$(currentTT).css({display: 'block', zIndex: '1000', position: 'absolute', left: e.pageX + 10, top: e.pageY - 40});} }); $('.ttParent img').bind('mouseout', function() {if (currentTT != null) { $(currentTT).remove();} currentTT = null; test = Math.ceil(Math.random() * currentTTColorPool.length - 1); currentTTColor = currentTTColorPool[test]; });  $('.ttParent .expandCollapse').bind('mousedown', function(e) {if($(this).attr('rel') == 'expand') {$(this).attr('rel', 'collapse'); $('.ttParent .collapsed').fadeOut('5000', function() {$('.ttParent .expanded').fadeIn('5000'); }); } else {$(this).attr('rel', 'expand'); $('.ttParent .expanded').fadeOut('5000', function() {    $('.ttParent .collapsed').fadeIn('5000'); }); } });
}
qerFunc.ellipseWords = function(selector, length) { $(selector).each(function(){ var t = $(this).text().split(' '); for (var i in t){ if (t[i].length > length){ t[i] = t[i].slice(0, length) + '...'; } } t = t.join(' '); $(this).text(t); }); }

$(document).ready(function(){qerFunc.initTT(); });