function preload() {
    externalLinks2();
    externalLinks();
    var href = document.location.href;
        var indexRes = href.search(/id=2/i);
        if (indexRes !=-1){ //if id=2 add in left column of main body
            document.getElementById("content").style.background = "url('http://medicaidconsultants.com/images/medicaid-left-col-background-orange.jpg') 0 0 repeat-y";
        }
        var indexRes = href.search(/id=3/i);
        if (indexRes !=-1){ //if id=3 add in left column of main body
            document.getElementById("content").style.background = "url('http://medicaidconsultants.com/images/medicaid-left-col-background-orange.jpg') 0 0 repeat-y";
        }
        var indexRes = href.search(/medicaid-state-offices/i);
        if (indexRes !=-1){ //if id=3 add in left column of main body
            document.getElementById("content").style.background = "url('http://medicaidconsultants.com/images/medicaid-left-col-background-orange.jpg') 0 0 repeat-y";
        }
        var indexRes = href.search(/medicaid-massachusetts/i);
        if (indexRes !=-1){ //if id=3 add in left column of main body
            document.getElementById("content").style.background = "url('http://medicaidconsultants.com/images/medicaid-left-col-background-orange.jpg') 0 0 repeat-y";
        }
        var indexRes = href.search(/medicaid-cape-cod/i);
        if (indexRes !=-1){ //if id=3 add in left column of main body
            document.getElementById("content").style.background = "url('http://medicaidconsultants.com/images/medicaid-left-col-background-orange.jpg') 0 0 repeat-y";
        }
        
        /********************************/
        /**
        * sub-domains without orange sidebar
        ********************************/
        var indexRes = href.search(/medicaid-florida/i);
        var indexArticle = href.search(/florida-medicaid-planning-nursing-home/i);
        var indexArticle2 = href.search(/florida-medicaid-expanding-privatization/i);
        var indexArticle3 = href.search(/florida-medicaid-private-insurance-companies/i);
        var indexArticle4 = href.search(/florida-medicaid-patient-survey-hmo-wellcare-abuse/i);
        var indexArticle5 = href.search(/florida-medicaid-floridians-pay-more-taxes/i);
        var indexArticle6 = href.search(/florida-medicaid-benefits-cut/i);
        var indexArticle7 = href.search(/florida-medicaid-long-term-planning/i);
        
        if (indexArticle!=-1 || indexArticle2!=-1 || indexArticle3!=-1 || indexArticle4!=-1 || indexArticle5!=-1  || indexArticle6!=-1 || indexArticle7!=-1) { //if this is 'florida-medicaid-planning-nursing-home' found in the url
           //do not have the orange side bar
        }else if (indexRes !=-1 && indexArticle==-1){ //if 'medicaid-florida' is found in the url and 'florida-medicaid-planning-nursing-home' is NOT found in the url
            document.getElementById("content").style.background = "url('http://medicaidconsultants.com/images/medicaid-left-col-background-orange.jpg') 0 0 repeat-y";
        }
        
        /********************************/
        /**
        * sub-domain with orange sidebar
        ********************************/
        var indexRes = href.search(/medicaid-boca-raton/i);
        if (indexRes !=-1){
            document.getElementById("content").style.background = "url('http://medicaidconsultants.com/images/medicaid-left-col-background-orange.jpg') 0 0 repeat-y";
        }
        /* For extending the left column's orange background */
        var sd=window.location.href.split("/")[2].split(".")[0];
        if (sd=='medicaid-tampa' || sd=='medicaid-st-petersburg' || sd=='medicaid-california' || sd=='medicaid-santa-ana' || sd=='medicaid-anaheim' || sd=='medicaid-bakersfield' || sd=='medicaid-riverside' || sd=='medicaid-thousand-oaks' || sd=='medicaid-irvine' || sd=='medicaid-los-angeles' || sd=='medicaid-texas' || sd=='medicaid-dallas' || sd=='medicaid-alabama' || sd=='medicaid-birmingham' || sd=='medicaid-arizona' || sd=='medicaid-scottsdale' || sd=='medicaid-colorado' || sd=='medicaid-loveland' || sd=='medicaid-hawaii' || sd=='medicaid-honolulu' || sd=='medicaid-idaho' || sd=='medicaid-boise' || sd=='medicaid-indiana' || sd=='medicaid-evansville' || sd=='medicaid-minnesota' || sd=='medicaid-minneapolis' || sd=='medicaid-north-carolina' || sd=='medicaid-greensboro' || sd=='medicaid-ohio' || sd=='medicaid-columbus' || sd=='medicaid-akron' || sd=='medicaid-pennsylvania' || sd=='medicaid-pittsburgh' || sd=='medicaid-new-mexico' || sd=='medicaid-albuquerque' || sd=='medicaid-sarasota' || sd=='medicaid-orlando' || sd=='medicaid-naples' || sd=='medicaid-trenton' || sd=='medicaid-philadelphia' || sd=='medicaid-new-jersey' || sd=='medicaid-michigan' || sd=='medicaid-flint' || sd=='medicaid-fort-lauderdale' || sd=='medicaid-laws' || sd=='dc-medicaid' || sd=='maryland-medicaid' || sd=='medicaid-baltimore' || sd=='medicaid-jacksonville') {
            document.getElementById("content").style.background = "url('http://medicaidconsultants.com/images/medicaid-left-col-background-orange.jpg') 0 0 repeat-y";
        }
        
}

function over(ref, num) {
    this.ref = ref;
    if (num == 3) {
        this.ref.setAttribute('src','http://medicaidconsultants.com/images/medicaid-contact-us-mo3.png');
    } else if (num == 4) {
        this.ref.setAttribute('src','http://medicaidconsultants.com/images/medicaid-about-us-mo3.png');
    } else if (num == 2) {
        this.ref.setAttribute('src','http://medicaidconsultants.com/images/medicaid-home-mo2.png');
    } else if (num == 5) {
        this.ref.setAttribute('src','http://medicaidconsultants.com/images/medicaid-locations-mo2.png');
    }
}

function out(ref, num) {
    this.ref = ref;
    if (num == 3) {
        this.ref.setAttribute('src','http://medicaidconsultants.com/images/medicaid-contact-us5.png');
    } else if (num == 4) {
        this.ref.setAttribute('src','http://medicaidconsultants.com/images/medicaid-about-us3.png');
    } else if (num == 2) {
        this.ref.setAttribute('src','http://medicaidconsultants.com/images/medicaid-home2.png');
    } else if (num == 5) {
        this.ref.setAttribute('src','http://medicaidconsultants.com/images/medicaid-locations2.png');
    }
}

function externalLinks2() {
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") && anchor.getAttribute("rel2") == "external2") anchor.target = "_blank";
    }
}

function externalLinks() {
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
            anchor.target = "_blank";
        } else if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external, nofollow") {
            anchor.target = "_blank";
        }
    } 
}

