var tabs = ["Home", "About Us", "Contact Information"];
var titles = ["Welcome", "About", "Contact"];
var contents = ["<p>Sparta Pediatrics is a primary care pediatric practice, located in the heart of Sparta, New Jersey, providing care for newborn to college-aged children.  In keeping with our philosophy of maintaining your child&rsquo;s health, we believe in regular preventive care, immunization against vaccine-preventable diseases, and healthy practices of diet and lifestyle.</p>\
<p>Our physicians are certified by the <em>American Board of Pediatrics</em>, and the practice is in&#8209;network with over twenty of the leading health insurance companies.</p>\
<p>Please look around our web site for more details, or contact our office at <strong>(973)&nbsp;729&#8209;7400</strong> during normal business hours.</p>\
<p>Thanks,<br /><br />Dr. Catherine A. McHugh<br />Dr. Louis Jacobson</p>", 
"<p><strong>Sparta Pediatrics</strong> opened its doors in April 2004 in the Sparta Health and Wellness Center.  In 2008, we moved to the new Twins on Main offices, and we now occupy the first floor of 106 Main Street in Sparta, across from the Goddard School.</p>\
<p><strong>Dr. Catherine McHugh</strong> was born in Brooklyn and raised on Long Island.  She attended Stony Brook University for medical school and later was trained in pediatrics at the Duke University Medical Center, in Durham, N.C., completing her residency in 1991.  Dr. McHugh has nineteen years of experience in general pediatrics and adolescent medicine and has practiced in the Sparta area since 2002.</p>\
<p><strong>Dr. Louis Jacobson</strong>, originally from Baltimore, has over seventeen years of experience in pediatrics.  He graduated from Washington University in St. Louis and attended medical school at the University of Maryland at Baltimore.  After finishing his residency at the Duke University Medical Center, he completed one year of fellowship in behavior and development before beginning to practice general pediatrics.</p>\
<p>Both doctors are certified by the American Board of Pediatrics.</p>", 
"<p>If you are experiencing a life-threatening emergency, dial <strong>9&#8209;1&#8209;1</strong> immediately for assistance.</p>\
<p>Otherwise, to make an appointment to see the doctor, dial the office line at <strong>(973)&nbsp;729&#8209;7400</strong> and speak with a receptionist.  Our normal business hours are 9 am to 5 pm on weekdays.</p>\
<p>If you need to leave a message for the on-call physician outside of normal business hours, dial the office line, and follow the instructions on the recording.  The doctor will contact you as soon as possible.</p>" ];


function main() {

    if (emergency != '') {

        Builder.addText($('emergency'), emergency);

        $('emergency').style.display = 'table-cell';

    }

	add_tabs(tabs);

	select_tab(0);

}



function add_tabs(tab_names) {

    for (var i in tab_names) {

        Builder.addHTML($('menu'), '<div id="tab' + i + '" class="menubutton" onclick="select_tab(' + i + ')">' + tab_names[i] + '</div>');

	}

}



function select_tab(num) {

   for (var i in tabs) {

        if (i == num) {

            $('tab' + i).className = 'menubutton';

        } else {

            $('tab' + i).className = 'menubuttondark';

        }

    }

    Builder.clearElt($('title'));

    Builder.addText($('title'), titles[num]);

    Builder.setHTML($('body'), contents[num]);

}

