$(document).ready(function(){ /////////////////////////////////////////////////////////////////////////////////// ///////////////////////////// SEARCH FUNCTIONS //////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// var volunteer_array = { name: "name", uid: "Uid", oldUID: "OldUID", email: "Email", username: "Username", password: "Password", resetPassword: "ResetPassword", name: "Name", fname: "Fname", lname: "Lname", company: "Company", nickname: "Nickname", sex: "Sex", birthday_month: "Birthday_month", birthday_day: "Birthday_day", birthday_year: "Birthday_year", dob: "Dob", registered: "Registered", verified: "Verified", phone: "Phone", cellphone: "Cellphone", fax: "Fax", country: "Country", c_address: "C_address", c_city: "C_city", c_state_province: "C_state_province", c_postalcode: "C_postalcode", p_address: "P_address", p_city: "P_city", p_state_province: "P_state_province", p_postalcode: "P_postalcode", pastvolunteer: "Pastvolunteer", dietaryneeds: "Dietaryneeds", medicalconsiderations: "Medicalconsiderations", tshirt: "Tshirt", reference: "Reference", educationexperience: "Educationexperience", volunteerexperience: "Volunteerexperience", workexperience: "Workexperience", pasttrips: "Pasttrips", expectations: "Expectations", othernotes: "Othernotes", emergencyname: "Emergencyname", emergencyphone: "Emergencyphone", emergencyrelationship: "Emergencyrelationship", languageRating: "LanguageRating", admin: "Admin", status: "Status", narrative: "Narrative", prospectType: "ProspectType", prospectLastContact: "ProspectLastContact", prospectNextContact: "ProspectNextContact", prospectResponsible: "ProspectResponsible", prospectGroup: "ProspectGroup", prospectSource: "ProspectSource", reference1name: "Reference1name", reference1email: "Reference1email", reference1phone: "Reference1phone", reference2name: "Reference2name", reference2email: "Reference2email", reference2phone: "Reference2phone", interest: "Interest", skills: "Skills", felonies: "Felonies", knowledge: "Knowledge", livingabroad: "Livingabroad", independence: "Independence", groups: "Groups", makePrivate: "MakePrivate", date: "Date", };var trip_array = { trip_id: "Trip_id", uid: "Uid", oldUID: "OldUID", team_id: "Team_id", group_id: "Group_id", startdate: "Startdate", enddate: "Enddate", startdateText: "StartdateText", enddateText: "EnddateText", weeks: "Weeks", location: "Location", a_airport: "A_airport", a_flight: "A_flight", a_time: "A_time", d_airport: "D_airport", d_flight: "D_flight", d_time: "D_time", verify_flights: "Verify_flights", pauseCommunication: "PauseCommunication", deposit_duedate: "Deposit_duedate", funds_duedate: "Funds_duedate", flights_duedate: "Flights_duedate", program_fee: "Program_fee", transportation_fee: "Transportation_fee", esu_scholarship: "Esu_scholarship", group_scholarship: "Group_scholarship", leader_scholarship: "Leader_scholarship", child_scholarship: "Child_scholarship", credits: "Credits", communication_welcome: "Communication_welcome", management_welcome: "Management_welcome", communication_funds: "Communication_funds", communication_flights: "Communication_flights", confirmationCall: "ConfirmationCall", waiver: "Waiver", type: "Type", focus: "Focus", programCountry: "ProgramCountry", program: "Program", religiousFocus: "ReligiousFocus", cancelled: "Cancelled", tshirt: "Tshirt", shirt_sent: "Shirt_sent", nametags_ordered: "Nametags_ordered", insurance: "Insurance", follow_up: "Follow_up", funds_goal: "Funds_goal", responsible: "Responsible", teamLeader: "TeamLeader", facebookPage: "FacebookPage", estrellaMessage: "EstrellaMessage", donorMessage: "DonorMessage", donorConfirmation: "DonorConfirmation", surveySent: "SurveySent", quicklink: "Quicklink", department: "Department", expectation: "Expectation", confirmationEmail: "ConfirmationEmail", confirmationSent: "ConfirmationSent", date: "Date", };var team_array = { teamname: "Teamname", team_id: "Team_id", teamname: "Teamname", group_id: "Group_id", groupname: "Groupname", participants: "Participants", leaders: "Leaders", startdate: "Startdate", enddate: "Enddate", startdateText: "StartdateText", enddateText: "EnddateText", weeks: "Weeks", location: "Location", funds_goal: "Funds_goal", program_fee: "Program_fee", group_fee: "Group_fee", scholarships: "Scholarships", group_scholarship: "Group_scholarship", esu_scholarship: "Esu_scholarship", leader_scholarship: "Leader_scholarship", child_scholarship: "Child_scholarship", credits: "Credits", minors: "Minors", total_expense: "Total_expense", transportation_fee: "Transportation_fee", total_credit: "Total_credit", total_due: "Total_due", deposit: "Deposit", deposit_duedate: "Deposit_duedate", funds_duedate: "Funds_duedate", flights_duedate: "Flights_duedate", funds_raised: "Funds_raised", leader_id: "Leader_id", leader_name: "Leader_name", a_airport: "A_airport", a_flight: "A_flight", a_time: "A_time", d_airport: "D_airport", d_flight: "D_flight", d_time: "D_time", verify_flights: "Verify_flights", pauseCommunication: "PauseCommunication", focus: "Focus", type: "Type", programCountry: "ProgramCountry", program: "Program", religiousFocus: "ReligiousFocus", cancelled: "Cancelled", cancelled_date: "Cancelled_date", shirts_sent: "Shirts_sent", insurance: "Insurance", survey_sent: "Survey_sent", nametags_ordered: "Nametags_ordered", follow_up: "Follow_up", responsible: "Responsible", date: "Date", communication_welcome: "Communication_welcome", management_welcome: "Management_welcome", communication_funds: "Communication_funds", communication_flights: "Communication_flights", confirmationCall: "ConfirmationCall", communication_posttrip: "Communication_posttrip", confirmationSent: "ConfirmationSent", tshirt: "Tshirt", department: "Department", teamMessage: "TeamMessage", };var donor_array = { lname: "lname", donor_id: "Donor_id", uid: "Uid", fname: "Fname", lname: "Lname", email: "Email", address: "Address", street: "Street", city: "City", state_province: "State_province", state: "State", postal_code: "Postal_code", zip: "Zip", country: "Country", phone: "Phone", cellphone: "Cellphone", amount: "Amount", volunteer_credit: "Volunteer_credit", team_credit: "Team_credit", team_id: "Team_id", trip_id: "Trip_id", herofund_id: "Herofund_id", heroteam_id: "Heroteam_id", rid: "Rid", check_number: "Check_number", type: "Type", method: "Method", fund: "Fund", payer_id: "Payer_id", order_num: "Order_num", gift_greeting: "Gift_greeting", gift_firstname: "Gift_firstname", gift_lastname: "Gift_lastname", gift_email: "Gift_email", calendars: "Calendars", unique_id: "Unique_id", session_id: "Session_id", shipping_fname: "Shipping_fname", shipping_lname: "Shipping_lname", shipping_street: "Shipping_street", shipping_city: "Shipping_city", shipping_state: "Shipping_state", shipping_zip: "Shipping_zip", shipping_country: "Shipping_country", storeDesc: "StoreDesc", shipped: "Shipped", date: "Date", company: "Company", recurring: "Recurring", recurring_id: "Recurring_id", recurring_type: "Recurring_type", terms: "Terms", sent: "Sent", annonymous: "Annonymous", hero: "Hero", tshirt: "Tshirt", refund: "Refund", refund_amount: "Refund_amount", unsubscribe: "Unsubscribe", thankyou: "Thankyou", REMOTE_ADDR: "REMOTE_ADDR", };var contact_array = { lastname: "lastname", contact_id: "Contact_id", uid: "Uid", firstname: "Firstname", company: "Company", lastname: "Lastname", name: "Name", title: "Title", email: "Email", school: "School", address: "Address", city: "City", state_province: "State_province", country: "Country", postal_code: "Postal_code", phone: "Phone", comments: "Comments", call: "Call", groupContact: "GroupContact", prospectID: "ProspectID", question: "Question", refer: "Refer", education: "Education", spanish: "Spanish", public_health: "Public_health", dental: "Dental", medical: "Medical", literacy: "Literacy", agriculture: "Agriculture", long_term: "Long_term", christian: "Christian", college: "College", highschool: "Highschool", nursing: "Nursing", socialwork: "Socialwork", segments: "Segments", witw: "Witw", witw_confirm: "Witw_confirm", ip: "Ip", unsubscribe: "Unsubscribe", date: "Date", added: "Added", }; $('#columnSelection').live('click', function(){ $('.columnSelect').toggle(); }); $('#clearColumns').live('click', function(){ $('.column:checked').attr('checked', false); }); $('.column').live('click', function () { var getColumns = ''; $.each($('.column:checked'), function(){ getColumns = getColumns + ',' + $(this).val(); }); $('.hiddenColumns').val(getColumns); }); $('#dbSearchForm .table').live('click', function () { $('.columns').html(''); $('.columnSelect').html(''); $('.columnSelect').html('[x] clear columns
'); var getColumns = ''; switch($(this).attr('array')) { case 'volunteer' : $.each(volunteer_array, function(key, value) { $('.columns').append(''); $('.columnSelect').append('' + value + '
'); getColumns = getColumns + ',' + key; }); break; case 'trip' : $.each(trip_array, function(key, value) { $('.columns').append(''); $('.columnSelect').append('' + value + '
'); getColumns = getColumns + ',' + key; }); break; case 'team' : $.each(team_array, function(key, value) { $('.columns').append(''); $('.columnSelect').append('' + value + '
'); getColumns = getColumns + ',' + key; }); break; case 'donor' : $.each(donor_array, function(key, value) { $('.columns').append(''); $('.columnSelect').append('' + value + '
'); getColumns = getColumns + ',' + key; }); break; case 'contact' : $.each(contact_array, function(key, value) { $('.columns').append(''); $('.columnSelect').append('' + value + '
'); getColumns = getColumns + ',' + key; }); break; } $('.hiddenColumns').val(getColumns); }); $('.newSearchField').live('click',function(){ var DB_array = $('.table:checked').attr('array'); var boolean = $(this).attr('type'); $('#addSearch').remove(); $('.addToSearch').replaceWith('
AND | OR
'); switch(DB_array) { case 'volunteer' : $.each(volunteer_array, function(key, value) { $('.columns').append(''); }); break; case 'trip' : $.each(trip_array, function(key, value) { $('.columns').append(''); }); break; case 'team' : $.each(team_array, function(key, value) { $('.columns').append(''); }); break; case 'donor' : $.each(donor_array, function(key, value) { $('.columns').append(''); }); break; case 'contact' : $.each(contact_array, function(key, value) { $('.columns').append(''); }); break; } return false; }); $('.columns').live('change',function(){ if($('.columns').val() == 'startdate' || $('.columns').val() == 'enddate' || $('.columns').val() == 'date'){ $('input').filter('.datepicker').datepicker({ changeMonth: true, changeYear: true, numberOfMonths: 3 }); } else $('input').filter('.datepicker').datepicker( "destroy" ); }); /////////////////////////////////////////////////////////////////////////////////// $(function() { var dates = $('.regstartdate, .regenddate').datepicker({ defaultDate: "+1M", changeMonth: true, numberOfMonths: 1, beforeShowDay: $.datepicker.onlySaturday, minDate: +30, onSelect: function(selectedDate) { var option = this.id == "startdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); $(function() { var dates = $('.allCalendar').datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, onSelect: function(selectedDate) { var option = this.id == "startdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); //////////////////////////////////////////////////////////////////////////////////// ////////////////////////// NICARAGUA DATES ///////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// $('#programCountry').live('change', function(){ if($(this).val() == 'Nicaragua'){ $.facebox('

Nicaragua Program!

Thank you for choosing to make a difference in Nicaragua! This message is to notify you that the program donation for our Nicaragua program is the same as our Published Rates. However, because we are still in start-up mode in Nicaragua without the economies of scale we have in the Dominican Republic, we are not able to offer the scholarships we offer in the D.R. There are no group, early sign-up, team leader, or child scholarships available.

We encourage you to start sending out letters to friends and family early to give yourself plenty of time to raise the necessary funds. Your efforts pre-trip and during your trip will have a significant impact in Nicaragua! Funds raised above the minimum program donation will be used to help purchase land for our new community center in Jinotega. Thank you!

'); $(".regstartdate, .regenddate").datepicker( "destroy" ); $(function() { var dates = $('.regstartdate').datepicker({ minDate: $.datepicker.parseDate('yymmdd', '20110430'), //this makes the datepicker start at the first available numberOfMonths: 1, beforeShowDay: $.datepicker.onlySaturday, onSelect: function(selectedDate) { var option = this.id == "startdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); $(function() { var dates = $('.regenddate').datepicker({ minDate: $.datepicker.parseDate('yymmdd', '20110507'), //this makes the datepicker start at the first available numberOfMonths: 1, beforeShowDay: $.datepicker.onlySaturday, onSelect: function(selectedDate) { var option = this.id == "enddate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); } else { $(".regstartdate, .regenddate").datepicker( "destroy" ); $(function() { var dates = $('.regstartdate, .regenddate').datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, beforeShowDay: $.datepicker.onlySaturday, onSelect: function(selectedDate) { var option = this.id == "startdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); } }); //////////////////////////////////////////////////////////////////////////////////// ////////////////////////// PROGRAM CHANGE ////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// $('#program').live('change', function(){ if($(this).val() == 'Spanish Immersion'){ $.facebox('

Spanish Immersion Program!

Beginning January 2nd, 2011, Orphanage Outreach is offering a Spanish Immersion Program in the Dominican Republic. From the time you exit the airport building in Santiago, your Orphanage Outreach experience will be "Spanish Only" - all conversations, announcements, and activities will be done in Spanish. The Spanish Immersion Program option is currently only available for groups of 10 or more.

Note: All of our programs offer an excellent opportunity to practice your Spanish; many of the children and adults you will be working with speak little or no English. The Spanish Immersion Program takes it a step beyond, in that speaking English is not permitted by our volunteers or staff.

'); } if($(this).val() == 'Health Corps - Medical Clinic' || $(this).val() == 'Health Corps - Dental Clinic'){ $.facebox('

Health Corps Clinics!

Thank you for choosing to make a difference through our Health Corps Clinics! Our clinics for 2011 are scheduled for February 26- March 19, 2011

Health Corps medical and dental clinics are open to medical and dental professionals, and students enrolled in an program resulting in a health certification - pharmacy, nursing, medical school, dental school, etc. Pre-med, pre-dental and public health students are invited to join our public health education program at any time throughout the year - you\'ll be making a long term difference by teaching nutrition, hygiene, disease prevention, dental health, and more.

Because of the significantly higher costs conducting a clinic versus a normal teaching volunteer experience, program donations for clinics will not include scholarships - there are no group scholarships, early sign up scholarships, etc. We encourage you to start sending out letters to friends and family early to give yourself plenty of time to raise the necessary funds. Your efforts pre-trip and during your trip will have a significant impact to the program! Thank you!

'); if($('#programCountry').val() != 'Nicaragua'){ $(".regstartdate, .regenddate").datepicker( "destroy" ); $(function() { var dates = $('.regstartdate').datepicker({ minDate: new Date(2011, 2-1, 26), maxDate: new Date(2011, 3-1, 12), changeMonth: true, numberOfMonths: 1, beforeShowDay: $.datepicker.onlySaturday, onSelect: function(selectedDate) { var option = this.id == "startdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); $(function() { var dates = $('.regenddate').datepicker({ minDate: new Date(2011, 3-1, 5), maxDate: new Date(2011, 3-1, 19), changeMonth: true, numberOfMonths: 1, beforeShowDay: $.datepicker.onlySaturday, onSelect: function(selectedDate) { var option = this.id == "startdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); } } else { if($('#programCountry').val() != 'Nicaragua'){ $(".regstartdate, .regenddate").datepicker( "destroy" ); $(function() { var dates = $('.regstartdate, .regenddate').datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, beforeShowDay: $.datepicker.onlySaturday, onSelect: function(selectedDate) { var option = this.id == "startdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); } } }); //////////////////////////////////////////////////////////////////////////////////// ////////////////////////// END DATES ////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// $(function() { var dates = $('.adminInsuranceStartdate, .adminInsuranceEnddate').datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, onSelect: function(selectedDate) { var option = this.id == "adminInsuranceStartdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); $(function() { var dates = $('.adminScheduleStartdate, .adminScheduleEnddate').datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, onSelect: function(selectedDate) { var option = this.id == "adminScheduleStartdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); $(function() { var dates = $('.adminDonorStartdate, .adminDonorEnddate').datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 2, onSelect: function(selectedDate) { var option = this.id == "adminDonorStartdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); $(function() { var dates = $('.adminSurveyStartdate, .adminSurveyEnddate').datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 2, onSelect: function(selectedDate) { var option = this.id == "adminSurveyStartdate" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); // VALIDATE REGISTRATION ON SUBMIT $('#regSubmit').live('click',function() { var error = 0; $('.check').each(function(){ if($(this).val() == '' || $(this).val() == '-1'){ error = 1; $(this).css('border-color', 'red'); } else $(this).css('border-color', ''); }); //Validate email fields if($('#email').val()!= $('#email2').val()){ error = 2; $('.emailValidate').html('*match e-mails').show(); } else $('.emailValidate').html('*match e-mails').hide(); //Validate password fields if($('#passwordcheck1').val() != $('#passwordcheck2').val()){ error = 3; $('.passwordValidate').html('*match passwords').show(); } else $('.passwordValidate').html('*match passwords').hide(); if(error != 0){ alert('Please make sure that all fields are filled in completely'); return false; } else{ $('#overlay').show(); $('#loading').show(); } }); //WAIVER SUBMIT $('#waiverSubmit').click(function() { var error = 0; $('.waiver').each(function(){ if($(this).attr('checked') == false) { error = 1; $(this).css('border-color', 'red'); }else $(this).css('border-color', ''); }); // Take action based on error response if(error != 0){ alert('Please check that you have read and agree to all sections of the Waiver Agreement'); return false; } else{ $('#overlay').show(); $('#loading').show(); } }); $('#username').live('blur',function() { var username = $(this).val(); $('.checkUsername').html(''); $.get('/registration/checkUsername',{username:username},function(check){ if(check > 0){ $('.checkUsername').html('username taken'); $('input[type=text]').attr('disabled','true'); $('#username').attr('disabled',''); }else{ $('.checkUsername').html('Available'); } }); }); $('.checkEmail').live('blur',function() { var email = $(this).val(); $('.checkEmail').html(''); $.get('/registration/checkEmail',{email:email},function(check){ if(check > 0){ $.facebox('

Email on File!

The email address that you have entered is already on file. Please login to register for a new Orphanage Outreach trip. Logging in to register is fast and easy as your previous information is on file.

If you are trying to register a family member, you will be able to do so on your family page in OO Connect

'); $('.checkEmail').html(''); $('input[type=text]').attr('disabled','true'); } $('.checkEmail').html(''); }); }); $('*').removeClass('nojs'); $('.links li').each(function () { var s = $('div', this).attr('style'); if(s == "") { $('div', this).remove(); } }); $('.links li').live('mouseenter', function () { var padleft = '15px'; if($(this).parents().hasClass('submenu')){padleft = '40px';} if($(this).parents().hasClass('supersubmenu')){padleft = '60px';} if($(this).parents().hasClass('superdupasubmenu')){padleft = '80px';} $(this).stop().animate({'paddingLeft': padleft}, 500); }).live('mouseleave', function () { var padleft = '6px'; if($(this).parents().hasClass('submenu')){padleft = '34px';} if($(this).parents().hasClass('supersubmenu')){padleft = '56px';} if($(this).parents().hasClass('superdupasubmenu')){padleft = '76px';} $(this).stop().animate({'paddingLeft':padleft}, 500); }); $('.megaContentListbox li').live('mouseenter', function () { var padleft = '15px'; $(this).stop().animate({'paddingLeft': padleft}, 500); }).live('mouseleave', function () { var padleft = '1px'; $(this).stop().animate({'paddingLeft':padleft}, 500); }); var contentArea = { 'wid' : $('#mainContentArea').outerWidth(), 'offs' : $('#mainContentArea').offset() } $('#menu #megaMenu .menulabel').each(function () { var mmContent = $(this); if(mmContent.attr('url')) if($('.megaMenuContent:empty', this).size() == 0) { $.get(mmContent.attr('url'), function (data) { mmContent.append(data); }); } }).live('mouseenter', function () { $('#menu #megaMenu .menulabel').each(function () { $(this).css({'backgroundColor':'#FFFFFF', 'borderBottomColor':'#4B7299'}); $('.megaMenuTitle', this).css({'color':'#4B7299'}); $('.megaMenuContent', this).css({'opacity':0}); }); var offsetpos = $(this).offset(); var mmContent = { 'ele' : $('.megaMenuContent', this) } if(mmContent.ele.size() == 1) { $(this).css({ 'backgroundColor':'#4B7299', 'borderBottomColor':'#CCCCCC'}); $('.megaMenuTitle', this).css({'color':'#FFFFFF'}); mmContent.ele.css({'left': '0px','top': '24px'}) mmContent.ele.stop().animate({'opacity':'1'}); mmContent.offsetPos= mmContent.ele.offset(); mmContent.wid= mmContent.ele.outerWidth(); var popupwidth = (mmContent.offsetPos.left) + mmContent.wid; var contentAWidth = (contentArea.wid+contentArea.offs.left); var moveContent = (popupwidth - contentAWidth); if(contentAWidth < popupwidth) { mmContent.ele.css({'left': '-' + (moveContent + 7) + 'px'}) } } else { $(this).css({ 'backgroundColor':'#FBFBFB', 'borderBottomColor':'#4B7299'}); $('.megaMenuTitle', this).css({'color':'#555555'}); } }).live('mouseleave', function () { $(this).css({'backgroundColor':'#FFFFFF', 'borderBottomColor':'#4B7299'}); $('.megaMenuContent', this).css({'left': '-1244222px'}).stop().animate({'opacity':0}); $('.megaMenuTitle', this).css({'color':'#4B7299'}); }); //$('.megaContentList').live('click', function(){var url = $(this).attr('url');self.location= url;}); //$('#loginModule .content').hide(); $('#loginModule .header').live('click', function() {$(this).parents().find('.content').animate({'height':'toggle'}, 750 , 'easeOutExpo');}); $('.hasmenu').live('click', function () { var menu = $(this).attr('menu'); $('div#' + menu).animate({'height':'toggle'}); return false; }); $('.adminEditPage').live('click',function(){ var pid = $(this).attr('pid'); area1 = new nicEditor({fullPanel : true,onSave : function(content, id, instance){ //confirm("Save changes to this page?"); $.post("/process/editSite", { content: content, pid: pid }); //alert("Content has been saved"); area1.removeInstance('adminEditArea'); }}).panelInstance('adminEditArea',{hasPanel : true}); return false; }); $('.editTripPersonalMessage').live('click',function(){ var trip_id = $(this).attr('trip_id'); area1 = new nicEditor({fullPanel : true,onSave : function(content, id, instance){ $.post("/connect/editPersonalMessage", { content: content, trip_id: trip_id }); area1.removeInstance('tripPersonalMessage'); }}).panelInstance('tripPersonalMessage',{hasPanel : true}); return false; }); $('.editTeamMessage').live('click',function(){ var team_id = $(this).attr('team_id'); area1 = new nicEditor({fullPanel : true,onSave : function(content, id, instance){ $.post("/connect/editTeamMessage", { content: content, team_id: team_id }); area1.removeInstance('TeamMessage'); }}).panelInstance('TeamMessage',{hasPanel : true}); return false; }); $('.editDonorMessage').live('click',function(){ var trip_id = $(this).attr('trip_id'); area1 = new nicEditor({fullPanel : true,onSave : function(content, id, instance){ $.post("/connect/editDonorConfirmation", { content: content, trip_id: trip_id }); area1.removeInstance('tripDonorMessage'); }}).panelInstance('tripDonorMessage',{hasPanel : true}); return false; }); $("#stwTemplate").live('change',function () { var str = $(this).val(); if (str > 0){ $.get("/connect/getTemplate",{email_id: str}, function(returned_data){ var hashes = location.href.slice(location.href.indexOf('?') + 1).split('&'); var hash = hashes[0]; var myNewString = returned_data.replace("[teamlink]", "http://www.outreach360.org/hero/team?" + hash); $("#stwMessage").val(myNewString); }); } else cleartext('#message'); }); $.isJson = function(str) { if ($.trim(str) == '') return false; str = str.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); } $('form[ajax="true"]').submit(function () { var action = $(this).attr('action'); var method = $(this).attr('method'); var data = $(this).serialize(); var callback = function (data) { if($.isJson(data) == true) { eval(" var redirect = " + data + ";"); window.location = redirect.LOCATION; } else if($.trim(data) == 'fail') { if($('#loginModule .errorClass').size() == 1) { $('#loginModule .errorClass') .animate({'paddingLeft' : '35px'}, 200, 'easeOutExpo') .animate({'paddingLeft' : '0px'}, 500, 'easeOutBounce'); } else { $('#loginModule .content').prepend("
"); $('#loginModule .errorClass').prepend(""); } return false; } else if($.trim(data) == 'loginFail') { if($('#loginModule .errorClass').size() == 1) { $('#loginModule .errorClass') .animate({'paddingLeft' : '35px'}, 200, 'easeOutExpo') .animate({'paddingLeft' : '0px'}, 500, 'easeOutBounce'); } else { $('#loginModule .content').prepend("
"); $('#loginModule .errorClass').prepend(""); } return false; } else { $.get('/components/' + data, function (menu) { $('#leftMenu').html(menu).animate({'backgroundColor':'#ffffcc'}).animate({'backgroundColor':'#FFFFFF'}); $('#loginModule').animate({'height':'toggle'}, 750, 'easeOutExpo',function(){$(this).remove();}); }); } }; switch(method){case 'post' : $.post(action, data, callback); break;case 'get' : $.get(action, data, callback); break;} return false; }); (function($){ // call setMask function on the document.ready event $( function(){ $('#phone').setMask('phone-us'); // options are explained below and are optional $('#cellphone').setMask('phone-us'); // options are explained below and are optional $('#emergencyphone').setMask('phone-us'); // options are explained below and are optional $('#decimal-us').setMask('decimal-us'); // options are explained below and are optional $('#cardNumber').setMask('all-credit'); } ); })(jQuery); $("#cardType").live('change',function () { if($("#cardType").val() == 'amex'){ $("#cardNumber").attr("maxlength","15"); $("#cardNumber").val(""); $("#CVV2").val(""); $("#CVV2").attr("maxlength","4"); $('#cardNumber').setMask('amex-credit'); // options are explained below and are optional } else{ $("#cardNumber").attr("maxlength","16"); $("#cardNumber").val(""); $("#CVV2").val(""); $("#CVV2").attr("maxlength","3"); $('#cardNumber').setMask('all-credit'); // options are explained below and are optional } }); $(".recurringToggle").live('change',function(){ if($(this).val() == 1) { $('#recurring_type').removeAttr('disabled'); $('#terms').removeAttr('disabled'); $('#tshirt').removeAttr('disabled'); } if($(this).val() == 0) { $('#recurring_type').attr('disabled', true); $('#terms').attr('disabled', true); $('#tshirt').attr('disabled', true); } }); $('#donationProcess').live('click',function(){ $('#overlay').show(); $('#loading').show(); }); $('form').submit(function(){ $('#overlay').show(); $('#loading').show(); }); $('#submitDonation').live('click',function(){ var error = 0; $('.check').each(function(){ if($(this).val() == '' || $(this).val() == '-1'){ error = 1; $(this).css('border-color', 'red'); } else $(this).css('border-color', ''); }); if(error != 0){ alert('Please make sure that all fields are filled in.'); return false; } }); $('#commentText').live('click',function(){ $(this).css({'height':'50px','color':'#000000','margin-bottom':'2px'}); $(this).val(''); $(this).removeAttr('id'); $('#commentSubmit').show(); $('#commentName').show(); }); $('#commentName').live('click',function(){ $(this).val(''); $(this).css('color','#000000'); }); $('a[rel*=facebox]').facebox(); $("#submitQuickLink").live('click',function(){ $.get('/connect/checkQuicklink?type=check',$('#updatequicklink').serialize(),function(data){ if(data == 1) $('#quicklinkResponse').html('quicklink taken; try again.'); else{ $.get('/connect/checkQuicklink?type=update',$('#updatequicklink').serialize(),function(getit){ $('#quicklinkResponse').html('quicklink updated!'); $('#quickLinkChange').html(getit); }); } }); return false; }); $('.showPhotoLink').live('click', function(){ var photoLink = $(this).attr('rel'); alert(photoLink); return false; }); $('.contentVideo').live('mouseenter',function(){ $('.playButton').css("background-image","url(/media/images/videos/play-hover.png)"); }).live('mouseleave', function () { $('.playButton').css("background-image","url(/media/images/videos/play.png)"); }); $('.step_container').each(function (i, val) { $('.panel_caption', this).height($(this).height()); }); $('.step_container').each(function (i, val) { var padding = { top : parseInt($('.panel_caption', this).css('paddingTop').split("px",1)), bottom : parseInt($('.panel_caption', this).css('paddingBottom').split("px",1)) }; padding = padding.top + padding.bottom; $('.panel_caption', this).height($(this).height() - padding); }); $('.toggleOutlookHide').live('click', function(){ var section = $(this).attr('alt'); $('.hideRow' + section).toggle(); }); $('#hideAll').live('click', function(){ $('.hideAll').toggle(); $('#hideAll').text('Show All Details'); return false; }); $('.togglePersonStatus').live('click', function(){ var uid = $(this).attr('uid'); var listID = $(this).val(); var url = '/admin/process/person'; $.get(url,{uid:uid,listID:listID,type:'updateStatus'},function(data){ }); }); $('#emsVSearch').click(function(){ $(this).val(''); $(this).css({'color': '#000000', 'font-style': 'none'}); }); });