setAjaxDiv("contentWrapper");
setGoogleAnalyticsID("UA-4418450-19");


var io_current_popup_navigation_menu = null;

function zxcPos(obj){
 var rtn=[obj.offsetLeft,obj.offsetTop];
 while(obj.offsetParent!=null){
  var objp=obj.offsetParent;
  rtn[0]+=objp.offsetLeft-objp.scrollLeft;
  rtn[1]+=objp.offsetTop-objp.scrollTop;
  obj=objp;
 }
 return rtn;
}



function popupNavigation( vo_target ) {

        if ( io_current_popup_navigation_menu != null ) {
            popdownNavigation();
        }

        n_test = zxcPos(vo_target);

	n_x = n_test[0] //vo_target.offsetLeft;
	n_y = n_test[1] //vo_target.offsetTop;
        n_height = vo_target.offsetHeight;
        n_width = vo_target.offsetWidth;

        o_nodes = vo_target.childNodes;
        
        for ( n_index = 0; n_index < o_nodes.length; n_index++ ) {

            if ( o_nodes.item(n_index) instanceof Object || typeof o_nodes.item(n_index) == "object" ) {

                if ( o_nodes.item(n_index).className == "subNavigation" ) {

                    io_current_popup_navigation_menu = o_nodes.item(n_index);

                    io_current_popup_navigation_menu.style.top = n_y + n_height + "px";
                    io_current_popup_navigation_menu.style.left = n_x + "px";
                    io_current_popup_navigation_menu.style.display = "block";

                    if ( io_current_popup_navigation_menu.offsetWidth < n_width ) {
                        io_current_popup_navigation_menu.style.width = n_width + "px";
                    }

                }


            }

        }


        document.onmouseover = function(event) {

            event = event || window.event;

            n_cords = zxcPos(io_current_popup_navigation_menu);

            if ( event.clientX < n_cords[0] || event.clientX > (n_cords[0] + io_current_popup_navigation_menu.offsetWidth) ||
                event.clientY < n_y || event.clientY > ( n_cords[1] + io_current_popup_navigation_menu.offsetHeight ) ) {

                popdownNavigation();

            }

        }
	
}

function popdownNavigation() {

        if ( io_current_popup_navigation_menu != null ) {
            io_current_popup_navigation_menu.style.display = "none";

            document.onmouseover = null;
        }

}




function submitShippingForm() {
    document.getElementById("shippingInfoForm").submit();
    return false;
}

var b_billing_form_submitted = false;

function submitBillingForm() {

    if (!b_billing_form_submitted) {
        b_billing_form_submitted = true;
        document.getElementById("billingInfoForm").submit();
        document.getElementById("processPaymentButton").innerHTML="Please Wait...";
    }

    return false;

}