$(document).ready(function() { if ($.browser.msie && (parseInt($.browser.version) <= 7)) { try { document.execCommand('BackgroundImageCache', false, true); } catch(e){} $('input').hover(function() { $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); }); } if (window.navigator.userAgent.indexOf('Chrome') !== -1) { $('html').css('-webkit-text-size-adjust', 'none'); } $('a[rel="external"]').attr('target', '_blank'); Cufon.replace('.Helvetica', {fontFamily:'Helvetica', textShadow:'1px 1px #666'}); /* nav */ var navTimer = null; $('.nav > li:has(".sub")').hover(function() { if (navTimer) clearTimeout(navTimer); $('.sub', this).fadeIn(500); }, function() { (function(li) { navTimer = setTimeout(function() { $('.sub', li).stop().fadeOut(500); }, 800); })(this); }); /* form */ (function() { if ($('.home-top .form').length > 0) { $('.home-top .form li input').each(function() { if ($(this).val() == '') { $(this).siblings('label').show(); } }); $('.home-top .form li').click(function() { $('label', this).hide(); $('input', this).focus(); }); $('.home-top .form li input').blur(function() { if ($(this).val() == '') { $(this).siblings('label').show(); } }); } })(); /* slider */ (function() { if ($('.testimonial').length < 1) return false; var slider = $('.testimonial'); var len = $('li', slider).length, index = 0, next = 0, speed = 4900, timer = null; if (len <= 1) return false; var autoplay = function() { index = next; next = index + 1; if (next >= len) next = 0; $('li', slider).eq(index).fadeOut('fast'); $('li', slider).eq(next).fadeIn('fast'); }; slider.hover(function() { clearInterval(timer); }, function() { timer = setInterval(autoplay, speed); }); timer = setInterval(autoplay, speed); })(); /* video */ if ($('.video .play').length > 0) { $('.video .play a').click(function() { $('.dialog-mask').height($(document).height()).show(); $('.dialog').css({marginLeft:-$('.dialog').outerWidth()/2+'px', marginTop:-$('.dialog').outerHeight()/2+'px'}).show(); return false; }); } }); function close_dialog() { $('.dialog').hide('fast', function() { $('.dialog-mask').hide(); }); }