Working Together
Remind your members that you’re a part of their community and ready to work together! This CU*Overdrive campaign provides a variety of materials to advertise your products and services.
Campaign #1226 includes:
Campaign ID: 1226
*/
/*
$('.c_tweet a')
.attr('href','https://twitter.com/share')
.attr('data-text','tweet:' + $(this).parent().children('textarea').text())
.attr('target','_blank')
.attr('data-count','none')
.addClass('twitter-share-buttom');
$.getScript('http://platform.twitter.com/widgets.js');
*/
$('.c_tweet a, .c_msg a').click(function(){
$(this).siblings('textarea').val(function(i,val){ return val.replace(/
/gi,"\n").replace(/<\/?p>/gi,"\n");}).slideToggle('fast').select();
})
//magic for 2012 order form
//jQuery('input[type=radio]').parents('li.gfield').not('li#field_20_7').next('li').css('background','green').children('input[type=number]').val('3333')
// jQuery('input[type=radio]').parents('li.gfield').next('li').css('background','red').children('div input[type=number]').val('3333')
$("label:contains('Lobby Posters')").parent('li').children('div').children('input').change(function(){
if(confirm('Would you like to use this number as the default?')){
$("label:contains('Lobby Posters')").parent('li').children('div').children('input').val( $(this).val() );
}
})
$("label:contains('Lobby Inserts')").parent('li').children('div').children('input').change(function(){
if(confirm('Would you like to use this number as the default?')){
$("label:contains('Lobby Inserts')").parent('li').children('div').children('input').val( $(this).val() );
}
})
$("label:contains('Mail Inserts')").parent('li').children('div').children('input').change(function(){
if(confirm('Would you like to use this number as the default?')){
$("label:contains('Mail Inserts')").parent('li').children('div').children('input').val( $(this).val() );
}
})
$("label:contains('Monthly Inserts')").parent('li').children('div').children('input').change(function(){
if(confirm('Would you like to use this number as the default?')){
$("label:contains('Monthly Inserts')").parent('li').children('div').children('input').val( $(this).val() );
}
})
$("label:contains('Quarterly Inserts')").parent('li').children('div').children('input').change(function(){
if(confirm('Would you like to use this number as the default?')){
$("label:contains('Quarterly Inserts')").parent('li').children('div').children('input').val( $(this).val() );
}
})
//$('input[type=submit].gform_button').click(function(){ $(this).submit(); $(this).attr('disabled','disabled'); $(this).parent().prepend('Your order is being submitted. This may take a minute. Please be patient while the form submits. You will receive an email confirming your order.
'); return true; });
$('.entry-content input[type=submit].gform_button').click(function(){
$(this).parent().prepend('Your order is being submitted. This may take a minute, this message will update when it is finished. Please be patient while the form submits. You will receive an email confirming your order.
');
$(this).attr('value','Please Wait...');
$(this).attr('disabled','disabled');
$('.entry-content form').submit();
return true;
});
if($('#campaign-pricing').size() && $('input#input_2_1[value*=collat]').size()){
$('#campaign-pricing').hide();
}
$('form#searchform').submit(function(){
var query = $('form#searchform #s').val();
$('form#searchform #s').val(query.replace("'",""));
return true;
});
//only do this section on the its me txt grand opening kit order form
if($('#gform_24').size()){
var kits_remaining = 30;
if(kits_remaining > 1){
$('div.gform_heading').append('Hurry, there are only '+kits_remaining+' kits remaining!
');
} else {
$('#gform_24').hide();
$('#content .hentry:first').append('Sorry, there are '+kits_remaining+' kits remaining!
');
}
$('form#gform_24').submit(function(){ return calculateTotals(); }) //end submit fn
$('#gform_submit_button_24').click(function(){ return calculateTotals(); }) //end submit fn
$('.ginput_quantity').change(function(){ return calculateTotals(); }) //end submit fn
function calculateTotals(){
var total_quantity = 0;
$('.ginput_quantity').each(function(){
if(parseInt( $(this).val() )){
total_quantity = total_quantity + parseInt($(this).val());
}
})
$('#input_24_41').val(total_quantity); //set hidden total quantity field value so we can do the math on it
if(total_quantity > kits_remaining){
$('div.gform_heading').append('Sorry, your order for '+total_quantity+' kits exceeds the total available '+kits_remaining+' remaining kits. Please reduce your order quantity and try again.
');
alert('Sorry, your order for '+total_quantity+' kits exceeds the total available '+kits_remaining+' remaining kits. Please reduce your order quantity and try again.');
return false;
} else {
$('#quantity_error').slideUp(300);
}
return true;
}
}
//scroll validation errors to the correct place
$(window).load(function() {
if( $(".gfield_error").size() > 0 ){
$('html, body').animate({ scrollTop: $(".validation_error:first").offset().top }, 2000);
}
});
//only do this section on the 2013 overdrive order form
if($('#gform_26').size()){
/* 2013 overdrive order form
Electronic: No Print Materials
Bronze: 5 Posters, 50 Lobby Inserts, 1,000 Statement Inserts
Silver: 5 Posters, 250 Lobby Inserts, 2,500 Statement Inserts
Gold: 10 Posters, 500 Lobby Inserts, 5,000 Statement Inserts
Platinum: 15 Posters, 1,000 Lobby Inserts, 10,000 Statement Inserts
Diamond: 20 Posters, 2,000 Lobby Inserts, 20,000 Statement Inserts
*/
$('#gform_26 label:contains(None)').parent('li').addClass('package none');
$('#gform_26 label:contains(Electronic)').parent('li').addClass('package electronic');
$('#gform_26 label:contains(Bronze)').parent('li').addClass('package bronze');
$('#gform_26 label:contains(Silver)').parent('li').addClass('package silver');
$('#gform_26 label:contains(Gold)').parent('li').addClass('package gold');
$('#gform_26 label:contains(Platinum)').parent('li').addClass('package platinum');
$('#gform_26 label:contains(Diamond)').parent('li').addClass('package diamond');
$('li.total_price input[type=text]').addClass('total_price_input');
//$('#gform_26 li.price input').addClass('readonly').attr('readonly','readonly');
$('#gform_26 li.package input').click(function(e){
//console.log(e);
var single_price = $('label[for="'+ $(this).attr('id') +'"] > span[both]').text().replace('$','');
var double_price = $('label[for="'+ $(this).attr('id') +'"] > span[both]').attr('both');
var price = single_price;
//if($('input[name='+ $(this).attr('name') +']:last:checked')){
if( $(this).parents('li.gfield').next('li.gfield').find('input[type=radio]:last:checked').size() > 0 ){
price = double_price;
//console.log('using double price');
}
//$(this).parents('li.gfield').next('li.gfield').find('input[type=radio]').next('label').children('span.price2').text('$'+single_price);
$(this).parents('li.gfield').next('li.gfield').find('input[type=radio]').next('label').children('span.price2').attr('price',single_price);
$(this).parents('li.gfield').next('li.gfield').find('input[type=radio]:last').next('label').children('span.price2').text('+ $' + (double_price-single_price) ).attr('price', double_price );
//$(this).parents('li.gfield').next('li.gfield').find('input[type=radio]:last').next('label').children('span.price2').text('$'+double_price );
//console.log($(this).attr('id')+' price '+ single_price + ', '+ double_price + ', total = '+price );
$(this).parent('li').removeClass('unselected').addClass('selected').siblings('li').removeClass('selected').addClass('unselected');
calculate_totals(e);
})
$('#field_26_6 input').click(calculate_totals); //update price if switching insurance carrier
function calculate_totals(e){
big_total = 0;
$('.contest_package input:checked').each(function(){
thisprice = parseInt( $(this).siblings('label').find('.price, .price2').text().replace('$',''));
if(thisprice){ big_total = big_total + thisprice; }
})
$('#input_26_31 input:checked').each(function(){
thisprice = parseInt( $(this).siblings('label').find('.price').attr('price'));
if(thisprice){ big_total = big_total + thisprice; }
})
$('.contest_dates .gfield_radio').find('input:last:checked').each(function(){
thisprice = parseInt( $(this).siblings('label').find('.price2').text().replace('+ $',''));
if(thisprice){ big_total = big_total + thisprice; }
})
// if processor is not Sage, price is TBD
if( $('#field_26_6 #choice_6_1:checked').size() > 0 ){
big_total = "Quote TBD";
}
$('li.total_price').hide().fadeIn('500');
$('li.total_price input[type=text]').val('$'+big_total);
}
$('#gform_26 .contest_dates input[type=radio]').click(function(e){
$(this).parents('li.contest_dates').prev('li').find('input[type=radio]:checked:first').click();
})
$('#field_26_5 .view_campaigns').colorbox({inline:true, href:"#ccal", height: "2700px", width:"600px"});
//$(':not(#field_26_5) .view_campaigns').colorbox({iframe:true,scrolling:true, height:"90%", width:"600px"});
$('#field_26_3 .view_campaigns').colorbox({inline:true, href:"#post-91396", height: "750px", width:"840px"});
$('#field_26_38 .view_campaigns').colorbox({inline:true, href:"#post-91397", height: "750px", width:"840px"});
$('#field_26_37 .view_campaigns').colorbox({inline:true, href:"#post-91398", height: "750px", width:"840px"});
$('#field_26_36 .view_campaigns').colorbox({inline:true, href:"#post-91399", height: "750px", width:"840px"});
}
//add rel: attr to images on cat pages to make colorbox slideshow work
$('#main img').attr('rel','group');
$('a.lightbox, a[href$=jpg], a[href$=gif], a[href$=png]').colorbox({rel:"group", slideshow:false, opacity:0.7});
//$('a.lightbox, a[href$=jpg], a[href$=gif], a[href$=png]').colorbox({rel:"group", transition:"fade"});
//$('div.entry-content ul li a').lightBox();
// add analytics async tracker to colorbox. note, admins wont have _gaq set
if(typeof _gaq != 'undefined'){
$(document).bind("cbox_complete", function(){
var href = $.colorbox.element().attr("href");
if (href) {
_gaq.push(["_trackPageview", href]);
//console.log('tracked!');
}
});
}
/* move the NEW icon to the correct horizontal position on load */
$('#newthumb').css('top', ($('.sidebar li.page-item-91920').position().top) - 10).fadeIn('slow');
})
-->