/****************************************************** * * Softscroll * ******************************************************/ jQuery(function(){ jQuery('a[href*=#]').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = jQuery(this.hash); target = target.length && target || jQuery('[name=' + this.hash.slice(1) +']'); if (target.length) { var targetOffset = target.offset().top; jQuery('html,body') .animate({scrollTop: targetOffset}, 1000); return false; } } }); }); /****************************************************** * * Replacing rel="external" for Strict XHTML using * ******************************************************/ jQuery(function() { jQuery('a[rel*=external]').live('click', function() { window.open(this.href); return false; }); }); /****************************************************** * * Validator code work-around * ******************************************************/ jQuery(function(){ jQuery('span.li').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('
  • ' + this.innerHTML + '
  • ')); }); jQuery('span.hr').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('
    ')); }); jQuery('span.ul').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('')); }); jQuery('span.h1').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('

    ' + this.innerHTML + '

    ')); }); jQuery('span.h2').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('

    ' + this.innerHTML + '

    ')); }); jQuery('span.h3').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('

    ' + this.innerHTML + '

    ')); }); jQuery('span.h4').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('

    ' + this.innerHTML + '

    ')); }); jQuery('span.h5').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('
    ' + this.innerHTML + '
    ')); }); jQuery('span.h6').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('
    ' + this.innerHTML + '
    ')); }); jQuery('span.p').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('

    ' + this.innerHTML + '

    ')); }); jQuery('span.div').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('
    ' + this.innerHTML + '
    ')); }); jQuery('span.div').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('
    ' + this.innerHTML + '
    ')); }); jQuery('span.div').each(function(){ var itsClass = 'class="'+jQuery(this).attr('class')+'"'; jQuery(this).replaceWith(jQuery('
    ' + this.innerHTML + '
    ')); }); }); /****************************************************** * * Cufon work around * ******************************************************/ jQuery(window).one("load", function(){ if(jQuery.browser.msie) { setTimeout(function(){ Cufon.refresh();}, 200); } }); /****************************************************** * * Default value on emailus * ******************************************************/ jQuery(function() { jQuery('input[type=text]').addClass('onBlur'); jQuery('textarea').addClass('onBlur'); jQuery('input[type=text]').focus(function() { jQuery(this).removeClass('onBlur'); if (this.value == this.defaultValue){ this.value = ''; } if(this.value != this.defaultValue){ this.select(); } }); jQuery('input[type=text]').blur(function() { if (this.value == ''){ jQuery(this).addClass('onBlur'); this.value = (this.defaultValue ? this.defaultValue : ''); } }); jQuery('textarea').focus(function() { jQuery(this).removeClass('onBlur'); if (this.value == this.defaultValue){ this.value = ''; } if(this.value != this.defaultValue){ this.select(); } }); jQuery('textarea').blur(function() { if (this.value == ''){ jQuery(this).addClass('onBlur'); this.value = (this.defaultValue ? this.defaultValue : ''); } }); }); /****************************************************** * * Colorbox * ******************************************************/ function startColorbox(){ jQuery("a[rel='iframe']").colorbox({iframe:true, innerWidth:650, innerHeight:488, rel:'nofollow' }); jQuery("a#map[rel='iframe']").colorbox({iframe:true, innerWidth:800, innerHeight:600, rel:'nofollow'}); if(jQuery('#hidemap').length != 0) { if(jQuery.browser.msie || jQuery.browser.opera) { var the_src = jQuery("#hidemap iframe").attr('src'); } else { var the_src = jQuery("#hidemap object").attr('data'); } var v = the_src.replace(/\\"/g,''); jQuery("a#map[rel='iframe']").attr("href", v); } jQuery("a.colorbox").colorbox({maxWidth:"98%", maxHeight:"98%"}); } jQuery(window).one("load", function(){ startColorbox(); }); /****************************************************** * * Social icons margin * ******************************************************/ jQuery(function(){ jQuery('#social a:first').css({'margin-left':'0'}); }); /****************************************************** * * Background menu * ******************************************************/ jQuery(window).one('load',function(){ jQuery('#navigation > div > ul > li').not('.current-menu-item').find('a:first').each(function(){ jQuery(this).before(''); var w = jQuery(this).parents('li').width(); jQuery(this).parents('li').find('.arrowUl').css('left',(w*0.5)-10); }); jQuery('#navigation > div > ul > li.current-menu-item').has('ul').find('a:first').each(function(){ jQuery(this).before(''); var w = jQuery(this).parents('li').width(); jQuery(this).parents('li').find('.arrowUl').css('left',(w*0.5)-10); }); jQuery('#navigation > div > ul > li').hover(function(){ jQuery('.arrowUl', this).show(80); },function(){ jQuery('.arrowUl', this).hide(80); }); jQuery('#navigation ul ul ul').each(function(){ jQuery(this).wrapInner(''); jQuery('li:first', this).before(''); }); }); /****************************************************** * * Initialize scrolldown menu * ******************************************************/ jQuery(function() { jQuery('#navigation > div > ul').superfish({ delay:200, animation:{opacity:'show',height:'show'}, speed:150, autoArrows:false, dropShadows:false }); }); /****************************************************** * * Effect on search box * ******************************************************/ jQuery(function() { var searchInner = jQuery('#search_box input[type="text"]').hide(); var searchForm = jQuery('#search_box form').css({'width':'40px'}); var search_box = jQuery('#search_box'); search_box .mouseover(function(){ search_box.css({'background-color':'#eeeeee'}); searchForm.stop(true,false).animate({'width':'162px'},120, function() { searchInner.show(); }); searchInner.stop(true,false).animate({'margin-left':'10px'},120); }) .mouseout(function(){ searchForm.stop(true,false).animate({'width':'40px'},120, function() { search_box.css({'background-color':'transparent'}); searchInner.hide(); }); searchInner.stop(true,false).animate({'margin-left':'-112px'},120); }); }); /****************************************************** * * UnderCarousel * ******************************************************/ jQuery(function(){ if(jQuery('.slideshow').size()!=0){ var w = jQuery(window).width(); //window width var s = jQuery('.slideshow .slider img').size()*500; //width of a series of images var inW = w/s; //visible series of images if (Math.floor(inW) % 2 === 0 || Math.floor(inW) == 0) { var wI = (Math.floor(inW)+4)*(s); } else { var wI = (Math.floor(inW)+3)*(s); } jQuery('#shadowCarouselBottom, #shadowCarouselTop').css({'width':wI+'px'}); jQuery('#innerCarousel').css({'width':wI+'px','margin-left':'-'+(((wI-w)*0.5)-250)+'px'}); var allImages = []; jQuery(".slideshow .slider img").each(function() { allImages.push(jQuery(this).attr('src')); }); var i = 0; if (Math.floor(inW) % 2 === 0 || Math.floor(inW) == 0) { var wh = Math.floor(inW)+4; } else { var wh = Math.floor(inW)+3; } while(i < wh){ //create a carousel of blockCarousel, four more than visible jQuery.each(allImages, function(key, value) { var imgScript = ''; jQuery('#innerCarousel').append(imgScript); }); i++; } } }); /****************************************************** * * Slideshow * ******************************************************/ jQuery(window).one('load',function() { jQuery('.cc_caption').not('.countone').each(function(){ var h = jQuery(this).height()+80; jQuery(this).css({'bottom':'-'+h+'px'}); }); jQuery('.slideshow').each(function(){ if(jQuery(this).hasClass('fading')){ jQuery(this).find('.slider').cycle({ activePagerClass: 'activeSlide', after: onAfter, before: onBefore, cleartype: true, cleartypeNoBg: true, easing: 'easeInOutBack', fx: 'fade', manualTrump: false, next: '.slideshow .next', pause: 'true', pager: '.slideshow .nav', prev: '.slideshow .prev', speed: 500, timeout: 6000 }); } else { jQuery(this).find('.slider').cycle({ activePagerClass: 'activeSlide', after: onAfter, before: onBefore, cleartype: true, cleartypeNoBg: true, easing: 'easeInOutBack', fx: 'scrollHorz', manualTrump: false, next: '.slideshow .next', pause: 'true', pager: '.slideshow .nav', prev: '.slideshow .prev', speed: 500, timeout: 6000 }); } }); jQuery('.slideshow .slider').cycle('pause'); function onBefore(currSlideElement, nextSlideElement, options, forwardFlag) { var h = jQuery('.cc_caption', currSlideElement).height()+80; jQuery('.cc_caption', currSlideElement).animate({'bottom':'-'+h+'px'},150); if( (options.nextSlide > options.currSlide || (options.nextSlide == 0 && options.currSlide == options.slideCount-1)) && !(options.nextSlide == options.slideCount-1 && options.currSlide == 0)) { if (options.nextSlide > options.currSlide) { var s = options.nextSlide - options.currSlide; var i; for( i=0; i < s; i++){ jQuery('#innerCarousel img').eq(i).each(function() { jQuery(this).animate({'width':'0'},800,function(){jQuery('#innerCarousel img:last').after(this).css({'width':'500px'})}); }); } } else { jQuery('#innerCarousel img').eq(0).animate({'width':'0'},800,function(){jQuery('#innerCarousel img:last').after(this).css({'width':'500px'})}); } } else if (options.nextSlide < options.currSlide || (options.nextSlide == options.slideCount-1 && options.currSlide == 0)) { if (options.nextSlide < options.currSlide) { var s = -(options.nextSlide - options.currSlide); var l = (jQuery('#innerCarousel img').length)-1; var i; for( i=0; i < s; i++){ jQuery('#innerCarousel img').eq(l-i).each(function() { var last = jQuery(this); jQuery('#innerCarousel img:first').before(last); last.css({'width':'0'}).animate({'width':'500px'},800); }); } } else { var last = jQuery('#innerCarousel img:last'); jQuery('#innerCarousel img:first').before(last); last.css({'width':'0'}).animate({'width':'500px'},800); } } } function onAfter(currSlideElement, nextSlideElement, options, forwardFlag) { jQuery('.cc_caption', nextSlideElement).animate({'bottom':'0'},150); } jQuery('.slideshow').hover(function(){ jQuery('.prev', this).show(); jQuery('.next', this).show(); },function(){ jQuery('.prev', this).hide(); jQuery('.next', this).hide(); }); jQuery('.slideshow .prev, .slideshow .next, .slideshow .nav a').hover(function(){ jQuery('.slideshow .slider a').bind("click", function(){ return false; }); },function(){ jQuery('.slideshow .slider a').unbind("click"); }); }); jQuery(window).one('load',function(){ jQuery('.slideshow .slider').cycle('resume'); }); /****************************************************** * * Accordion * ******************************************************/ jQuery(document).ready(function() { var s = jQuery('.slideaccordion ul li').size(); jQuery('.slideaccordion ul li').css({'width':(1000/s)+'px'}); jQuery('.slideaccordion ul').kwicks({ min: 50, //sticky: true, defaultKwick: 1, spacing: 0, duration: 800, easing: 'easeOutBack', expanding: function(){ jQuery('.cc_caption').not('.countone').each(function(){ var h = jQuery(this).height()+80; jQuery(this).animate({'bottom':'-'+h+'px'},150); }); }, collapsing: function(){ jQuery('.cc_caption').not('.countone').each(function(){ var h = jQuery(this).height()+80; jQuery(this).animate({'bottom':'-'+h+'px'},150); }); }, completed: function(){ jQuery('li.active .cc_caption').not('.countone').animate({'bottom':'0'},150); } }); }); /****************************************************** * * Links in cc_caption * ******************************************************/ jQuery(document).ready(function() { jQuery('span.linkSlider').each(function(){ var theText = jQuery(this).text(); var theUrl = theText.substring((theText.lastIndexOf('href="') + 6), theText.lastIndexOf('"')); var theLink = theText.substring(theText.lastIndexOf('>') + 1); jQuery(this).text(theLink+'||'+theUrl); }); jQuery('.linkSlider').mouseover(function(){ jQuery(this).css({'text-decoration':'none'}); jQuery(this).parent().parent().bind("click.myDisable", function() { return false; }); }) .mouseout(function(){ jQuery(this).css({'text-decoration':'underline'}); jQuery(this).parent().parent().unbind("click.myDisable"); }) jQuery('.linkSlider').each(function(){ var href = jQuery(this).text(); var href2 = href.substring(href.lastIndexOf('|') + 1); var href3 = href.substring(href.lastIndexOf('|') - 1); if (href.indexOf("external") >= 0) { jQuery(this).click(function(){ window.location.href = href2; }); } else { jQuery(this).click(function(){ window.open(href2); }); } var removeHref = jQuery(this).text().replace(href3,""); jQuery(this).text(removeHref); }); }); /****************************************************** * * Teaserrow * ******************************************************/ (function(jQuery){ jQuery.fn.wrapChildren = function(options) { var options = jQuery.extend({ childElem : undefined, sets : 1, wrapper : 'div class="teaserrow"' }, options || {}); if (options.childElem === undefined) return this; return this.each(function() { var elems = jQuery(this).children(options.childElem); var arr = []; elems.each(function(i,value) { arr.push(value); if (((i + 1) % options.sets === 0) || (i === elems.length -1)) { var set = jQuery(arr); arr = []; set.wrapAll(jQuery("<" + options.wrapper + ">")); } }); }); } })(jQuery); jQuery(function() { jQuery('.teasers').each(function(){ jQuery(this).wrapChildren({ childElem : '.teaser' , sets: 3}); }); jQuery('.teasers.cycle').each(function(){ var hM = jQuery('.teasers.cycle').attr('title'); if(hM){ jQuery(this).wrapChildren({ childElem : '.teaserrow' , sets: hM}); } jQuery('.teasers.cycle').attr('title',''); }); jQuery('.teaserrow').each(function(){ jQuery('.teaser:last', this).css({'margin-right':'0'}); }); jQuery('.teasers.sorting').wrapInner('
    '); }); function tallest_li(){ jQuery('.teasers.sorting').each(function() { var tallest = 0; jQuery('li',this).each(function(){ var thisHeight = jQuery(this).height(); if(thisHeight > tallest ) { tallest = thisHeight; } }); jQuery('li',this).height(tallest); }); } jQuery(window).one('load',function(){ tallest_li(); }); /****************************************************** * * Another button workaround * ******************************************************/ jQuery(function(){ jQuery('.button, .more-link').each(function(){ jQuery(this).html(jQuery(this).html().replace(/[ ]/g," ")); }); jQuery('.more-link').each(function(){ jQuery(this).before('
    ').after('
    '); }); }); /****************************************************** * * showcase overlay * ******************************************************/ function showcase_overlay(){ jQuery('.showcase').each(function(){ var w = jQuery(this).width(); var h = jQuery(this).height(); var sH = jQuery('.covershowcase',this).height()+20; var r = jQuery('.readMore',this); jQuery('.covershowcase',this).css({'bottom':'-'+sH+'px'}).append(r); jQuery('a',this).hover(function(){ jQuery('.covershowcase',this).stop(true,false).animate({'bottom':'0'},150); jQuery('.readMore',this).stop(true,false).animate(); }, function() { jQuery('.covershowcase',this).stop(true,false).animate({'bottom':'-'+sH+'px'},80); jQuery('.readMore',this).stop(true,false).animate(); }); }); } jQuery(function(){ showcase_overlay(); }); /****************************************************** * * Tabs, Accordion & Show/hide * ******************************************************/ jQuery(window).one("load", function(){ jQuery('.tabs').each(function() { var thisT = jQuery(this); var thisUl = jQuery(this).find('ul'); thisT.find('li.tabTitle').appendTo(thisUl); thisUl.after(''); thisT.find('.tabContent').appendTo('.tabDestination',thisT); jQuery('.tabContent').find('br').addClass('stillAlive'); thisT.find('br:not(.stillAlive)').remove(); if(jQuery.browser.msie && jQuery.browser.version < 8) { thisT.after('

     

    ');; } }); jQuery('.tabs').tabs({ fx: { opacity: 'toggle', duration: 'fast' } }); }); jQuery(function() { jQuery('.accordion').accordion({ autoHeight: false }); jQuery('.accordion').wrap('
    '); jQuery('.accordion a.tab').before(''); /* IE8 workaround */ }); jQuery(function() { jQuery('.showhide a.tab').before(''); /* IE8 workaround */ jQuery('.showhide a.tab').click(function() { if (jQuery(this).parent().find('div').is(":hidden")) { jQuery(this).parent().find('div').slideDown('slow'); jQuery(this).removeClass('ui-state-inactive'); jQuery(this).addClass('ui-state-active'); return false; } else { jQuery(this).parent().find('div').slideUp('slow'); jQuery(this).removeClass('ui-state-active'); jQuery(this).addClass('ui-state-inactive'); } }).parent().find('div').slideUp('slow'); }); /****************************************************** * * Overlay icons 1 * ******************************************************/ function overlay_icons(){ jQuery('.entry').find('a:has(img)').each(function(){ if(!jQuery(this).parents('.teaser').hasClass('showcase') && !jQuery(this).hasClass('noMore')) { jQuery(this).css({'position':'relative','display':'block','overflow':'hidden'}); var w = jQuery('img', this).width(); var h = jQuery('img', this).height(); var m = jQuery('img', this).css('margin-left'); var href = jQuery(this).attr('href'); if (href.match(/.jpg|.gif|.png/)) { jQuery(this).find("img").after(''); } else if (href.match(/vimeo.com|youtube.com/)) { jQuery(this).find("img").after(''); } else { jQuery(this).find("img").after(''); } jQuery(this).hover(function(){ jQuery('.readMore',this).stop(true,false).animate({'height':((h*0.5)+22)+'px'},150); }, function() { jQuery('.readMore',this).stop(true,false).animate({'height':'0'},150); }); } }); } jQuery(window).one('load',function(){ overlay_icons(); }); /****************************************************** * * Overlay icons 2 * ******************************************************/ jQuery(window).one('load',function(){ jQuery('.sidebar').find('a:has(img)').each(function(){ var w = jQuery('img', this).width(); var h = jQuery('img', this).height(); var m = jQuery('img', this).css('margin-left'); var href = jQuery(this).attr('href'); if (href.match(/.jpg|.gif|.png/)) { jQuery(this).find("img").after(''); } else if (href.match(/vimeo.com|youtube.com/)) { jQuery(this).find("img").after(''); } else { jQuery(this).find("img").after(''); } jQuery(this).hover(function(){ jQuery('.readMore',this).stop(true,false).animate({'height':((h*0.5)+22)+'px'},150); }, function() { jQuery('.readMore',this).stop(true,false).animate({'height':'0'},150); }); }); }); /****************************************************** * * Overlay icons 3 * ******************************************************/ jQuery(function(){ jQuery('.showcase .entry a:has(img)').each(function(){ jQuery(this).css({'position':'relative','display':'block','overflow':'hidden'}); var w = jQuery('img', this).width(); var h = jQuery('img', this).height(); var href = jQuery(this).attr('href'); if(!jQuery(this).parents('.showcase').hasClass('in_category')){ if (href.match(/.jpg|.gif|.png/)) { jQuery(this).find(".icons").text('E'); } else if (href.match(/vimeo.com|youtube.com/)) { jQuery(this).find(".icons").text('W'); } else { jQuery(this).find(".icons").text('M'); } } jQuery(this).hover(function(){ jQuery('.readMore',this).stop(true,false).animate({'height':((h*0.5)+22)+'px'},150); }, function() { jQuery('.readMore',this).stop(true,false).animate({'height':'0'},150); }); }); }); /****************************************************** * * Heading margin * ******************************************************/ jQuery(function(){ jQuery('.content h1, .content h2, .content h3, .content h4, .content h5, .content h6, .section h1, .section h2, .section h3, .section h4, .section h5, .section h6, .sidebar h1, .sidebar h2, .sidebar h3, .sidebar h4, .sidebar h5, .sidebar h6').each(function(){ var obj = jQuery(this).prev(); if(!obj.html()){ jQuery(this).css('margin-top','0'); } }); }); /****************************************************** * * Teasers cycle * ******************************************************/ jQuery(document).ready(function() { jQuery('.teasers.cycle').each(function(){ jQuery(this).wrap('
    '); jQuery(this).before('
    '); jQuery(this).prevAll('.prevteaser').wrapInner('
    '); jQuery(this).after('
    '); jQuery(this).nextAll('.nextteaser').wrapInner('
    '); }); jQuery('.wrapTeaser').hover(function(){ jQuery('.prevteaser, .nextteaser',this).show(); },function(){ jQuery('.prevteaser, .nextteaser',this).hide(); }); jQuery('.teasers.cycle').each(function(){ var t = jQuery(this); var n = t.parents('.wrapTeaser').find('.nextteaser'); var p = t.parents('.wrapTeaser').find('.prevteaser'); t.cycle({ cleartype: true, cleartypeNoBg: false, //easing: 'easeInOutBack', fx: 'scrollHorz', manualTrump: false, pause: 'true', speed: 500, timeout: 6000, next: n, prev: p } ); }); jQuery('.teasers.cycle').cycle('resume'); jQuery('.wrapTeaser').css({'overflow':'hidden','position':'relative','width':'920px','margin':'0 -40px','padding':'0 40px'}); jQuery('.wrapTeaser').each(function(){ var h = jQuery(this).find('.teasers').height(); jQuery('.prevteaser', this).css({'height':(h)+'px'}); jQuery('.nextteaser', this).css({'height':(h)+'px'}); jQuery('.arrowLeft', this).css({'top':((h*0.5)-15)+'px'}); jQuery('.arrowRight', this).css({'top':((h*0.5)-15)+'px'}); }); }); jQuery(window).one('load',function(){ jQuery('.teasers.cycle').cycle('resume'); }); /****************************************************** * * Sidebar margin * ******************************************************/ jQuery(function(){ jQuery('.content').each(function(){ jQuery('.sidebar:last',this).css({'margin-right':'0'}); }); }); /****************************************************** * * Quicklinks * ******************************************************/ jQuery(function() { var sizeSidebar = jQuery('#footer .sidebar').size(); if (sizeSidebar == 3) { jQuery('#footer .sidebar').css({'width':'280px'}); jQuery('#quicklinks .multilist').makeacolumnlists({cols:2,colWidth:0,equalHeight:false,startN:1}); var ulMultilist = jQuery('.li_container .multilist').size(); jQuery('.multilist').css({'width':280/ulMultilist+'px'}); jQuery('.multilist ul').css({'width':280/ulMultilist+'px'}); jQuery('.multilist li').css({'width':(280/ulMultilist)-10+'px'}); } else if (sizeSidebar == 2) { jQuery('#footer .sidebar').css({'width':'440px'}); jQuery('.sidebar#quicklinks .multilist').css({'width':'440px'}); jQuery('#quicklinks .multilist').makeacolumnlists({cols:4,colWidth:0,equalHeight:false,startN:1}); var ulMultilist = jQuery('.li_container .multilist').size(); jQuery('.multilist ul').css({'width':440/ulMultilist+'px'}); jQuery('.multilist ul li').css({'width':(440/ulMultilist)-10+'px'}); } else if (sizeSidebar == 1) { jQuery('#footer .sidebar').css({'width':'920px','margin':'0'}); jQuery('.sidebar#quicklinks .multilist').css({'width':'920px','margin':'0'}); jQuery('#quicklinks .multilist').makeacolumnlists({cols:6,colWidth:0,equalHeight:false,startN:1}); var ulMultilist = jQuery('.li_container .multilist').size(); jQuery('.multilist ul').css({'width':920/ulMultilist+'px'}); jQuery('.multilist ul li').css({'width':(920/ulMultilist)-10+'px'}); } jQuery('.sidebar#quicklinks .multilist li ul').each(function(){ var w = jQuery(this).parents('li').width(); jQuery(this).css('width',w); }); jQuery('.sidebar#quicklinks .multilist li ul li').each(function(){ var w = jQuery(this).parents('ul').width(); jQuery(this).css('width',w-10); }); }); /****************************************************** * * Email us form: validation and replace * ******************************************************/ jQuery(document).ready(function() { jQuery("#emailus").validate(); jQuery.extend(jQuery.validator.messages, { required: 'This field is required', number: 'Numbers only', email: 'Type a valid email address' }); jQuery.validator.addMethod("your-email", function(value, element) { return this.optional(element) || /^((?!Your Email).)*$/.test(value); }, "Please change default text"); jQuery.validator.addMethod("phone-number", function(value, element) { return this.optional(element) || /^((?!Phone Number).)*$/.test(value); }, "Please change default text"); jQuery.validator.addMethod("comments", function(value, element) { return this.optional(element) || /^((?!Comments).)*$/.test(value); }, "Please change default text"); }); jQuery(document).ready(function() { jQuery('input.inputbutton.small').each(function(){ var v = jQuery(this).val(); var f = jQuery(this).parents('form'); jQuery(this).hide(); f.after(''); f.nextAll('span.button.small').css({'margin-top':'0'}).text(v).click(function(){ f.submit(); f.find('input[type=submit]').click(); }); }); }); /****************************************************** * * Featured area * ******************************************************/ jQuery(window).one('load',function(){ if(jQuery('#feature .button').length!=0){ var w = jQuery('#feature .button').width()+80; } else { var w = 0; } var h = jQuery('#feature .button').height()+48; jQuery('#feature .quote').css({'width':(920-w)}); var h2 = jQuery('#feature .quote').height(); if(h2>h){ jQuery('#feature .button').css({'margin-top':(h2-h)*0.5}); } }); /****************************************************** * * Footer animation * ******************************************************/ jQuery(document).ready(function() { var d = jQuery(document).height(); var h = jQuery('#footer').height(); jQuery('.slideToggle').slideUp(0); jQuery('#bottomborder').css({'margin-top':'-40px'}); jQuery('#footer h3').click(function(){ if(jQuery('#footer .slideToggle').is(':visible')){ jQuery('#footer .slideToggle').slideUp(1500); jQuery('#bottomborder').animate({'margin-top':'-40px'},1500); jQuery('.toggleArrow').hide(); jQuery('.toggleRarrow').show(); } else { jQuery('#footer .slideToggle').slideDown(1500); jQuery('html, body').animate({scrollTop: d}, 1500); jQuery('#bottomborder').animate({'margin-top':'0'},1500); jQuery('.toggleArrow').show(); jQuery('.toggleRarrow').hide(); } }); jQuery('#footer h3').css({'margin-top':'-75px','position':'absolute'}); }); /****************************************************** * * Widget list * ******************************************************/ jQuery(function(){ jQuery('.sidebar .cc_widget:first').css('margin-top','10px'); jQuery('.sidebar .cc_widget').not(':last').after(''); jQuery('.sidebar .cc_widget').find('li:not(.current-menu-item) a').before('H'); jQuery('.sidebar .cc_widget').find('li.current-menu-item a').before('C'); jQuery('.sidebar .cc_widget').find('li').not(':has(ul)').not(':last').after(''); jQuery('.sidebar .cc_widget li ul').before(''); jQuery('.cc_widget ul:not(#recentcomments) li:not(.current-menu-item) a').hover( function() { jQuery(this).stop(true,false).animate({'padding-left': '25px'},200, function() { jQuery(this).prev('.arrowSideHover').show(); }); }, function() { jQuery(this).prev('.arrowSideHover').hide(); jQuery(this).stop(true,false).animate({'padding-left': '10px'},200); }); }); /****************************************************** * * Sitemap * ******************************************************/ jQuery(function(){ jQuery('.sitemap li a').before('H'); jQuery('.sitemap ul').find('li').not(':has(ul)').not(':last-child').after(''); jQuery('.sitemap li ul').before(''); jQuery('.sitemap ul li a').hover( function() { jQuery(this).stop(true,false).animate({'padding-left': '25px'},200, function() { jQuery(this).prev('.arrowSideHover').show(); }); }, function() { jQuery(this).prev('.arrowSideHover').hide(); jQuery(this).stop(true,false).animate({'padding-left': '10px'},200); }); }); /****************************************************** * * Check-list * ******************************************************/ jQuery(function(){ jQuery('.check li').prepend('S'); jQuery('.check .li').prepend('S'); }); /****************************************************** * * Margin img post * ******************************************************/ jQuery(function(){ jQuery('a').has('img.alignleft, img.alignright, img.alignnone, img.aligncenter').css('margin-bottom','20px'); jQuery('a').has('img.alignleft').css('float','left'); jQuery('a').has('img.alignright').css('float','right'); jQuery('a').has('img.alignnone').css('float','none'); }); /****************************************************** * * Accordion tab * ******************************************************/ jQuery(function(){ jQuery('.accordion .tab').prepend(''); jQuery('.showhide .tab').prepend(''); jQuery('.openClose').text('+'); jQuery('.ui-state-active .openClose').text('-'); jQuery('.accordion .tab').live('click',function(){ var t = jQuery(this).parents('.accordion'); t.find('.openClose').text('+'); t.find('.ui-state-active .openClose').text('-'); }); jQuery('.showhide .tab').click(function(){ var t = jQuery(this).parents('.showhide'); var v = t.find('.openClose').text(); if(v=='-') { t.find('.openClose').text('+'); } else { t.find('.openClose').text('-'); } }); }); /****************************************************** * * Auto columns * ******************************************************/ jQuery(document).ready (function() { if(jQuery.browser.msie || jQuery.browser.opera) { jQuery('.multicolumns').columnize({columns:3}); jQuery('.multicolumns .column').css({'width':'280px','margin-right':'40px'}); jQuery('.section .multicolumns .column').css({'width':'160px','margin-right':'40px'}); jQuery('.multicolumns').each(function(){ jQuery(this).find('.column:last').css({'margin-right':'0'}); }); } }); /****************************************************** * * Table.confront * ******************************************************/ function equalHeight(group) { var tallest = 0; group.each(function() { var thisHeight = jQuery(this).height(); if(thisHeight > tallest) { tallest = thisHeight; } }); group.height(tallest+20); } jQuery(window).one("load", function(){ jQuery('table.confront').each(function(){ jQuery('td:last',this).css({'border-right':'none'}); //var thisW = jQuery(this).width(); var laLength = jQuery('td').length; var laLength2 = jQuery('td.highlight').length; if(laLength2){ jQuery('td',this).css({'width':(100/laLength)-(laLength2*2)+'%'}); jQuery('td.highlight',this).css({'width':(100/laLength)+(laLength2*2)+'%'}); } else { jQuery('td',this).css({'width':(100/laLength)+'%'}); } jQuery('td',this).each(function(){ var titleW = jQuery(this).width(); jQuery('.titleTable',this).css('width',titleW+'px'); }); equalHeight(jQuery(this).find('.titleTable')); }); }); /****************************************************** * * Calendar td * ******************************************************/ jQuery(function(){ jQuery('.widget_calendar td, .widget_calendar th').css({'width':100/7+'%'}); var tdW = (jQuery('.widget_calendar table').width()/7)-4; jQuery('.widget_calendar td, .widget_calendar th').css({'height':tdW+'px'}); jQuery('.widget_calendar a').css({'line-height':tdW+'px'}); }); jQuery(function() { jQuery('.widget_calendar td, .widget_calendar th').hover( function() { jQuery(this).addClass('hover'); }, function() { jQuery(this).removeClass('hover'); }); jQuery('.widget_calendar td:has("a")').addClass('ahover'); }); /****************************************************** * * Recent posts * ******************************************************/ jQuery(window).one('load',function() { if (jQuery('.post_slider').length != 0) { jQuery('.post_slider').each(function(){ var t = jQuery(this); var tP = t.parents('.widget_ccslidingnews'); var p = jQuery('.prev',tP); var n = jQuery('.next',tP); t.cycle({ fx:'scrollHorz', speed: 500, timeout: 6000, cleartype: true, cleartypeNoBg: false, pause:true, prev:p, next:n }); }); } if (jQuery('.post_slider2').length != 0) { jQuery('.post_slider2').each(function(){ var t = jQuery(this); var tP = t.parents('.cc-sliding-comments'); var p = jQuery('.prev',tP); var n = jQuery('.next',tP); t.cycle({ fx:'scrollHorz', speed: 500, timeout: 6000, cleartype: true, cleartypeNoBg: false, pause:true, prev:p, next:n }); }); } }); /****************************************************** * * Bordercolumn * ******************************************************/ jQuery(window).one('load',function(){ jQuery('.content').each(function(){ var h = jQuery(this).height(); jQuery('.bordercolumn', this).css('height',h+'px'); }); }); /****************************************************** * * Float IE/ work around * ******************************************************/ jQuery(document).ready(function() { jQuery('a:has(img.alignleft)').each(function(){ jQuery(this).addClass('alignleft'); jQuery(this).find('img').removeClass('alignleft'); }); jQuery('a:has(img.alignright)').each(function(){ jQuery(this).addClass('alignright'); jQuery(this).find('img').removeClass('alignright'); }); }); /****************************************************** * * Tag cloud * ******************************************************/ jQuery(window).one("load", function(){ jQuery('.widget_tag_cloud a').each(function(){ var fSize = jQuery(this).css("font-size"); var fSizenoPx = fSize.replace('px', ''); if(fSizenoPx<12) { jQuery(this).css({'color':'#6692ae'}); } else if(fSizenoPx>=12 && fSizenoPx<13) { jQuery(this).css({'color':'#5283a3'}); } else if(fSizenoPx>=13 && fSizenoPx<14) { jQuery(this).css({'color':'#3d7598'}); } else if(fSizenoPx>=14 && fSizenoPx<15) { jQuery(this).css({'color':'#29668e'}); } else if(fSizenoPx>=15 && fSizenoPx<16) { jQuery(this).css({'color':'#145883'}); } else if(fSizenoPx>=17 && fSizenoPx<18) { jQuery(this).css({'color':'#00436e'}); } else if(fSizenoPx>=18 && fSizenoPx<19) { jQuery(this).css({'color':'#003d65'}); } else if(fSizenoPx>=19 && fSizenoPx<20) { jQuery(this).css({'color':'#00375b'}); } else { jQuery(this).css({'color':'#003252'}); } }); }); /****************************************************** * * Margin comment form * ******************************************************/ jQuery(function(){ jQuery('span.reply').mouseup(function(){ var replyID = (jQuery(this).attr('id')); var replyReplace = parseFloat(replyID.replace('depth_','')); if(replyReplace!='1'){ jQuery('#respond').css({'margin-left':'-'+((40*(replyReplace+1)+15))+'px'}); } else{ jQuery('#respond').css({'margin-left':'0'}); } }); jQuery('#reply-title small').mouseup(function(){ jQuery('#respond').css({'margin-left':'0px'}); }); }); /****************************************************** * * Tags cand sharing * ******************************************************/ jQuery(window).one("load", function(){ var tagW = jQuery('#innertags').width(); var shareW = jQuery('#innershare').width(); var hovertagW = jQuery('#hovertag').width(); var hovershareW = jQuery('#hovershare').width(); jQuery('#tags').css({'width':'0'}); if(tagW > (590-(hovertagW+hovershareW))) { jQuery('#innertags').css({'width':tagW-(hovertagW+hovershareW)+'px'}); } else { jQuery('#innertags').css({'width':tagW+5+'px'}); } var tagW2 = jQuery('#innertags').width(); jQuery('a#hovertag, #tags').hover(function(){ jQuery('#tags').stop(true,false).animate({'width':tagW2+'px'},300); },function(){ jQuery('#tags').stop(true,false).animate({'width':'0','padding-right':0},300); }); jQuery('#postshare').css({'width':'0','padding-right':0}); if(shareW > (595-(hovertagW+hovershareW))) { jQuery('#innershare').css({'width':shareW-(hovertagW+hovershareW)+'px'}); } else { jQuery('#innershare').css({'width':shareW+'px'}); } var shareW2 = jQuery('#innershare').width(); jQuery('a#hovershare, #postshare').hover(function(){ jQuery('#postshare').stop(true,false).animate({'width':shareW2+'px','padding-right':'5px'},300); },function(){ jQuery('#postshare').stop(true,false).animate({'width':'0','padding-right':0},300); }); }); /****************************************************** * * Tooltips * ******************************************************/ jQuery(window).one('load',function() { //Tooltips var tip; jQuery(".tip").prev('a').hover(function(){ //Caching the tooltip and removing it from container; then appending it to the body tip = jQuery(this).nextAll('.tip').remove(); jQuery('body').append(tip); tip.show(); //Show tooltip }, function() { tip.hide().remove(); //Hide and remove tooltip appended to the body jQuery(this).after(tip); //Return the tooltip to its original position }).mousemove(function(e) { //console.log(e.pageX) if( typeof(tip) != "undefined") { var mousex = e.pageX + 20; //Get X coodrinates var mousey = e.pageY + 20; //Get Y coordinates var tipWidth = tip.width(); //Find width of tooltip var tipHeight = tip.height(); //Find height of tooltip //Distance of element from the right edge of viewport if(jQuery.browser.msie || jQuery.browser.opera) { var scrollN = jQuery('html').scrollTop(); } else { var scrollN = jQuery('body').scrollTop(); } var tipVisX = jQuery(window).width() - (mousex + tipWidth); var tipVisY = jQuery(window).height() - ((mousey-scrollN) + tipHeight); if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport mousex = e.pageX - tipWidth - 20; jQuery(this).find('.tip').css({ top: mousey, left: mousex }); } if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport mousey = e.pageY - tipHeight - 20; tip.css({ top: mousey, left: mousex }); } else { tip.css({ top: mousey, left: mousex }); } } }); }); /****************************************************** * * Sorting * ******************************************************/ (function($) { $.fn.sorted = function(customOptions) { var options = { reversed: false, by: function(a) { return a.text(); } }; $.extend(options, customOptions); $data = $(this); arr = $data.get(); arr.sort(function(a, b) { var valA = options.by($(a)); var valB = options.by($(b)); if (options.reversed) { return (valA < valB) ? 1 : (valA > valB) ? -1 : 0; } else { return (valA < valB) ? -1 : (valA > valB) ? 1 : 0; } }); return $(arr); }; })(jQuery); jQuery(function() { if(jQuery('.sorting').length!=0){ jQuery('.sorting').each(function(){ var sortThis = jQuery(this); var filterType = jQuery('.filter_form input[name="type"]', sortThis); var filterSort = jQuery('.filter_form input[name="sort"]', sortThis); jQuery('.filter_form input[name="type"]:checked',sortThis).parents('label').addClass('checked'); jQuery('.filter_form input[name="sort"]:checked',sortThis).parents('label').addClass('checked'); // get the first collection var applications = jQuery('.sorting_ul',sortThis); // clone applications to get a second collection var data = applications.clone(); // attempt to call Quicksand on every form change filterType.add(filterSort).change(function(e) { jQuery('.filter_form input[name="type"]', sortThis).parents('label').removeClass('checked'); jQuery('.filter_form input[name="sort"]', sortThis).parents('label').removeClass('checked'); jQuery('.filter_form input[name="type"]:checked',sortThis).parents('label').addClass('checked'); jQuery('.filter_form input[name="sort"]:checked',sortThis).parents('label').addClass('checked'); if (jQuery('.filter_form input[name="type"]:checked',sortThis).val() == 'teaser') { var filteredData = data.find('li'); } else { var filteredData = data.find('li[class*=' + jQuery('.filter_form input[name="type"]:checked',sortThis).val() + ']'); } // if sorted by date if (jQuery('.filter_form input[name="sort"]:checked',sortThis).val() == "date") { var sortedData = filteredData.sorted({ by: function(v) { return parseFloat(jQuery(v).attr("title")); } }); } else { // if sorted by name var sortedData = filteredData.sorted({ reversed: true, by: function(v) { return jQuery(v).find('h3').text().toLowerCase(); } }); } // finally, call quicksand applications.quicksand(sortedData, { duration: 800, easing: 'easeInOutQuad', attribute: 'id', enhancement: function() { tallest_li(); Cufon.refresh(); showcase_overlay(); overlay_icons(); startColorbox(); } }); }); }); } });