function DLPPage() {}

DLPPage.prototype.setHeadline = function(config){

    //TODO: Add rotating text logic.
    if ($(config.headlineText.text).length > 0) {//manipulate headline only if a value exist in config
        $('div#headline h1').empty();
        $('div#headline h1').append(config.headlineText.text[0]);
    }
    
    $('div#headline h1').css(config.headlineText.style[browserStyle]);
};

DLPPage.prototype.setSubHeadline = function(config){
    //TODO: Add rotating text logic.
    if ($(config.subHeadlineText.text).length > 0) {//manipulate headline only if a value exist in config
        $('div#headline h2').empty();
        $('div#headline h2').append(config.subHeadlineText.text[0]);
    }
    $('div#headline h2').css(config.subHeadlineText.style[browserStyle]);
};

DLPPage.prototype.setSubmitButton = function(config){
    $('div.submitImage input').css(config.submitButton.style[browserStyle]);
};

DLPPage.prototype.setFormAttributes = function(config){
    $('div#form div.formContents').css(config.form.style[browserStyle]);
    
    //set Arrow Styling
    $('div.formArrow').css(config.form.arrow.style[browserStyle]);
    
    //set Form Step Styling
    $('div [class*="formStep"]').css(config.form.steps.style[browserStyle]);
};

DLPPage.prototype.setHeaderAttributes = function(config){
    $('div#form').append('<div class="headerImage"><!-- empty --></div>');
    $('div.headerImage').css(config.header.style[browserStyle]);
};

DLPPage.prototype.execute = function(config){
    try {
        this.setHeadline(config);
    } catch (exception){}
    try {
        this.setSubHeadline(config);
    } catch (exception){}
    try {
        this.setSubmitButton(config);
    } catch (exception){}
    try {
        this.setFormAttributes(config);
    } catch (exception){}
    try {
        this.setHeaderAttributes(config);
    } catch (exception){}
};

function DLPPage1(){}
DLPPage1.prototype = new DLPPage();

DLPPage1.prototype.setFinancialAid = function(config){
    var financialAidDiv = $('em.financialAid').parents('div.statusQuestionTableRow');
    if ($(config.financialAidText.text).length > 0) {//manipulate financial aid text only if a value exist in config
        financialAidDiv.empty();
        financialAidDiv.append(config.financialAidText.text[0]);
    }
    financialAidDiv.css(config.financialAidText.style[browserStyle]);
};

DLPPage1.prototype.execute = function(config){
    try {
        this.setHeadline(config);
    } catch (exception){}
    try {
        this.setSubHeadline(config);
    } catch (exception){}
    try {
        this.setSubmitButton(config);
    } catch (exception){}
    try {
        this.setFormAttributes(config);
    } catch (exception){}
    try {
        this.setHeaderAttributes(config);
    } catch (exception){}
    try {
        this.setFinancialAid(config);
    } catch (exception){}
};

var browser = {
    type : function(){
        if ($.browser.msie) {
            if ($.browser.version > 6) {
                return "ie7";
            } else {
                return "ie6";
            }
        } else {
            return "firefox";
        }
    }
};


var processPage1 = new DLPPage1();
var processPage2 = new DLPPage();
var processPage3 = new DLPPage();
var processPage4 = new DLPPage();
var processPage5 = new DLPPage();
var browserStyle = browser.type();

