﻿/* ------------------------------- */
/* PAGE LOAD EVENT */
/* ------------------------------- */
function user_pageload_logic() {
    $(".container .box, .container .round-box").roundCorners();
    $('.round').corner();
    $('#wrapper #masthead #branding ul#nav li div.segment').hide();
    $('#wrapper #masthead #branding ul#nav li.navItem').hover(function() {
        var segmentId = $(this).attr('id');
        $(this).addClass("selected");
        $(this).find('#seg-' + segmentId).fadeIn(10);
    },
    function() {
        var segmentId = $(this).attr('id');
        $(this).removeClass("selected");
        $(this).find('#seg-' + segmentId).fadeOut(10);
    }
    );
    return false;
}
/* ------------------------------- */
/* User click button 1 */
/* ------------------------------- */
function button1_clicked() {
    /* Update the wide top box */
    ajax_update('div#box1', '/_ajax/box1_b.htm?a=1', true);
    ajax_update('div#box2', '/_ajax/box2_b.htm?a=1', true);
    ajax_update('div#box3', '/_ajax/box3_b.htm?a=1', true);
    ajax_update('div#box4', '/_ajax/box4_b.htm?a=1', true);
    /* Return a false */
    return false;
}
/* ------------------------------- */
/* User click button 1 */
/* ------------------------------- */
function butt_printcap_clicked() {
    /* Update the wide top box */
    ajax_update('div#box1', '/_ajax/box1_b.htm?a=1', true);
    ajax_update('div#box2', '/_ajax/box2_b.htm?a=1', true);
    ajax_update('div#box3', '/_ajax/box3_b.htm?a=1', true);
    ajax_update('div#box4', '/_ajax/box4_b.htm?a=1', true);
    /* Return a false */
    return false;
}

/* ------------------------------- */
/* I THINK THIS IS UNUSED... an early attempt at AJAX? */
/* ------------------------------- */

                var http_request2 = false;
                function layoutIdRequest() {
                    http_request2 = false;

                    if (window.XMLHttpRequest) { // Mozilla, Safari,...
                        http_request2 = new XMLHttpRequest();
                        if (http_request2.overrideMimeType) {
                            http_request2.overrideMimeType('text/html');
                        }
                    } else if (window.ActiveXObject) { // IE
                        try {
                            http_request2 = new ActiveXObject("Msxml2.XMLHTTP");
                        } catch (e) {
                            try {
                                http_request2 = new ActiveXObject("Microsoft.XMLHTTP");
                            } catch (e) {
                            }
                        }
                    }

                    if (!http_request2) {
                        return false;
                    }

                    var randNum = Math.floor(Math.random() * 1001);
                    var url = "/layoutid.jsp?s=" + randNum + "&page=" + "hp" + "&layoutIdIndex="
				 		+ "2"
				 		+ "&oriRef=" + "http://www.northendbar.com/timeout.html";

                    http_request2.open('GET', url, true);
                    http_request2.send(null);
                }
                layoutIdRequest();		
