/*

Developed by:

___           ___                 
/__/|         /__/\        ___     
|  |:|         \  \:\      /  /\    
|  |:|          \  \:\    /  /:/    
__|  |:|      _____\__\:\  /__/::\    
/__/\_|:|____ /__/::::::::\ \__\/\:\__ 
\  \:\/:::::/ \  \:\~~\~~\/    \  \:\/\
\  \::/~~~~   \  \:\  ~~~      \__\::/
\  \:\        \  \:\          /__/:/ 
\  \:\        \  \:\         \__\/  
\__\/         \__\/               

*/

/*******************************
Debug & Console
*******************************/

// Allow for console.log to not break IE
if (typeof console == "undefined" || typeof console.log == "undefined") {
    var console = {
        log: function() { }
    };
}

/*******************************
Configuration Settings
*******************************/

// Declare Global Namespace
if (typeof (conoco) == 'undefined') {
    var conoco = {
        config: {}
    };
}

/*******************************
EDITABLE SECTION
*******************************/

/* Configuration */
conoco.settings = {

    // minimum flash version required
    minimumFlashVersion: '9.0.0',

    // animation speeds in milliseconds
    animation: {
        quicker: 100,
        quick: 150,
        medium: 300,
        slowish: 700,
        slow: 1000,
        // scale ratio of icons when hovered
        scale: {
            header: 0.75,
            touts: 0.82
        }
    },

    mobile: {
        redirect: 'http://www.conoco.mobi/',
        regex: /(Mobile|AvantGo|iPhone|BlackBerry|HTC|LG|MOT|Nokia|NOKIAN|PSP|SAMSUNG|SonyEricsson)/i
    },

    // contact us ajax form configuration
    contactUs: {
        url: 'Handlers/ContactUsHandler.ashx', //debug=0'
        messages: {
            submit: "Submitting form",
            error: "There was a server error processing your request"
        },
        form: {
            defaultText: {
                comments: 'Type Your Comments',
                location: "Where did you visit conoco",
                dateDay: new Date().getDate(),
                dateMonth: new Date().getMonth() + 1,
                dateYear: new Date().getFullYear(),
                firstName: 'Your first name',
                lastName: 'Your last name',
                address1: 'Address',
                address2: 'Apt #',
                city: 'City name',
                zipcode: 'xxxxx',
                phoneArea: 'xxx',
                phonePrefix: 'xxx',
                phoneSuffix: 'xxxx',
                email: 'yourname@email.com',
                emailConfirm: 'yourname@email.com'
            },
            validation: {
                subject: [{
                    type: 'empty',
                    prompt: 'Please select a topic'
}],
                    comments: [{
                        type: 'empty',
                        prompt: 'Don\'t forget to leave a comment'
}],
                        firstName: [{
                            type: 'empty',
                            prompt: 'Please enter your first name.'
}],
                            lastName: [{
                                type: 'empty',
                                prompt: 'Please enter your last name.'
}],
                                state: [{
                                    type: 'empty',
                                    prompt: 'Please select your state'
}],
                                    email: [
					{
					    type: 'empty',
					    prompt: 'Please enter your e-mail address'
					},
					{
					    type: 'email',
					    prompt: 'Please enter a valid e-mail address'
					},
					{
					    type: 'match[emailConfirm]',
					    prompt: 'Please verify your e-mail matches your current email'
					}
				],
                                    emailConfirm: [
					{
					    type: 'empty',
					    prompt: 'Please re-enter your e-mail address'

					},
					{
					    type: 'match[email]',
					    prompt: 'Please verify your e-mail matches your current email'
					}
				]
                                }
                            }
                        },

                        // register form ajax form configuration
                        register: {
                            url: '/Handlers/RegistrationHandler.ashx', //debug=0'
                            messages: {
                                error: "There was a server error processing your request"
                            },
                            height: {
                                normal: '256px',
                                thankYou: '135px',
                                errors: '315px'
                            },
                            form: {
                                defaultText: {
                                    registerName: 'Your Name',
                                    registerEmail: 'Your Email',
                                    registerZipcode: 'Zipcode'
                                },
                                validation: {
                                    registerName: [
					{
					    type: 'not[Your Name]',
					    prompt: "Please enter your name."
					},
					{
					    type: 'empty',
					    prompt: 'Please enter your name.'
					}
				],
                                    registerEmail: [
					{
					    type: 'not[Your Email]',
					    prompt: 'Please enter your e-mail address'
					},
					{
					    type: 'empty',
					    prompt: 'Please enter your e-mail address'
					},
					{
					    type: 'email',
					    prompt: 'Please enter a valid e-mail address'
					}
				],
                                    registerZipcode: [
					{
					    type: 'not[Zipcode]',
					    prompt: "Please enter your zipcode."
					},
					{
					    type: 'empty',
					    prompt: 'Please enter your zipcode'
					},
					{
					    type: 'zip',
					    prompt: 'Please enter a valid zipcode'
					}
				]
                                }
                            }
                        },

                        precacheableImages: ['media/images/register-sprite.png']

                    };
                    jQuery.extend(conoco.config, conoco.settings);

                    // after attached to conoco, unset temporary settings object 
                    delete conoco.settings;
