$(document).ready(function() { $('#menu-header-menu .sub-menu').each(function(index, el) { $(this).closest('li').addClass('dropdown'); }); if($('#home-slider').length > 0) { formfocused = false; function onAfter() { var data_box = $(this).attr('data-box'); $('#featured-content article').removeClass('active'); $('#featured-content article[data-box=' + data_box + ']').addClass('active'); } $('#home-slider').cycle({ fx: 'scrollLeft', speed: 750, timeout: 6000, //next: '#next', //prev: '#prev' , pager: '#slider-navigation', after: onAfter }); $('#home-slider').hover( function(){ $('#home-slider').cycle('pause'); }, function(){ if (!formfocused) { $('#home-slider').cycle('resume'); } } ); $('#fullname, #email, #phonenumber').focus(function(){ $('#home-slider').cycle('pause'); formfocused = true; }); $('#fullname, #email, #phonenumber').blur(function(){ formfocused = false; }); } if($('#latest-news').length > 0) { $('#latest-news-articles').cycle({ fx: 'scrollUp', speed: 2000, timeout: 9000, }); } if($('#signup').length > 0) { replace_placeholders(); //$('#contactus #submit').click(function(){ $("#signup").submit(function(){ $(this).find('[placeholder]').each(function() { var input = $(this); if (input.val() == input.attr('placeholder')) { input.val(''); } }) var formurl = $("#signup").attr('action'); var gdocsurl = $("#signup input#gdocsurl").val(); //$("form#contact").attr('action'); var fullname = $("#signup input#fullname").val(); var email = $("#signup input#email").val(); var phonenumber = $("#signup input#phonenumber").val(); oktogo = true; if (fullname == ''){ oktogo = false; $("#signup input#fullname").addClass('error'); } if (email == ''){ oktogo = false; $("#signup input#email").addClass('error'); } //if (phonenumber == ''){ //oktogo = false; //$("input#phonenumber").addClass('error'); //} if (oktogo){ var datastring = "gdocsurl="+gdocsurl+"&entry.0.single="+fullname+"&entry.1.single="+email+"&entry.2.single="+phonenumber; datastring += "&pageNumber=0&backupCache=0&submit=Submit"; //console.log(datastring); //return; $.ajax({ type: "POST", url: formurl, data: datastring, dataType:"xml", success: function(data,textStatus,XMLHttpRequest) { $('#signup').remove(); $('#premiere-offload-carrier').append("
"); $('#premiere-offload-carrier #signup').html("





Thank you for your submission!

") .append("

.

") .hide() .fadeIn(500, function() { //$('#formmoreinfo #signup'); }); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert('There was an error.'); } }); return false; }else{ replace_placeholders(); alert('The contact form is missing data. Please fill in the required fields and try again.'); return false; } return false; }); } if($('#companies').length > 0) { $('#companies-nav li:first').addClass('active'); $('#companies .hentry.fullsize').first().addClass('active'); $('#companies .hentry.fullsize').not('.active').hide(); $('#companies-nav').on('click', 'a:not(".active")', function(e) { e.preventDefault(); var href = $(this).attr('href'); $('#companies .hentry.fullsize.active').fadeOut(function() { $('' + href).fadeIn().addClass('active'); }).removeClass('active'); $('#companies-nav .active').removeClass('active'); $(this).parent().addClass('active'); }); $("a[rel^='wp-video-lightbox']").prettyPhoto({ animation_speed: 'fast', slideshow: 5000, autoplay_slideshow: false, opacity: 0.80, show_title: true, allow_resize: true, default_width: 640, default_height: 480, counter_separator_label: '/', theme: 'pp_default', horizontal_padding: 20, hideflash: false, wmode: 'opaque', autoplay: false, modal: false, deeplinking: false, overlay_gallery: true, keyboard_shortcuts: true, changepicturecallback: function(){}, callback: function(){}, ie6_fallback: true, markup: '
\
 
\
\
\
\
\
\
\
\
\
\
\
\ Expand \
\ next \ previous \
\
\
\
\ Previous \

0/0

\ Next \
\

\ {pp_social} \ Close \
\
\
\
\
\
\
\
\
\
\
\
\
', gallery_markup: '', image_markup: '', flash_markup: '', quicktime_markup: '', iframe_markup: '', inline_markup: '
{content}
', custom_markup: '', social_tools: false }); } }) function replace_placeholders() { $('[placeholder]').focus(function() { var input = $(this); if (input.val() == input.attr('placeholder')) { input.val(''); input.removeClass('placeholder'); } }).blur(function() { var input = $(this); if (input.val() == '' || input.val() == input.attr('placeholder')) { input.addClass('placeholder'); input.val(input.attr('placeholder')); } }).blur(); }