$j(document).ready(function() {
    $j('#nav-primary > li > a').hover(
		function() {
		    var tab = $j("#" + this.id);
		    var position = tab.position();
		    var get_id = this.id.split("_");
		    var nav_id = get_id[1];
		    $j('#nav-dropdown_' + nav_id).removeClass('hide');
		    $j('#nav-dropdown_' + nav_id).css('left', position.left + 'px');
		},
		function() {
		    var get_id = this.id.split("_");
		    var nav_id = get_id[1];
		    $j('#nav-dropdown_' + nav_id).addClass('hide');
		}
	);

    $j('div.nav-dropdown').hover(
		function() {
		    var dropdown = $j("#" + this.id);
		    dropdown.removeClass('hide');
		},
		function() {
		    var dropdown = $j("#" + this.id);
		    dropdown.addClass('hide');
		}
	);
});

function showProductNavSection(sectionID) {
    $j("#nav-products-lists > div").addClass("hide");
    $j("#nav-products-nav > li").removeClass("active");
    $j("#nav-products-section_" + sectionID).removeClass("hide");
    $j("#nav-products-nav-tab_" + sectionID).addClass("active");
}

function open_popup(url, w, h, resize, scroll, wname) {
    /* place this in onclick or href: "javascript:open_popup('[url]','[width of window]','[height of window]','[resize option]','[scroll opiton]','[windowname]');" */
    wname = (wname == null) ? "popwin" : wname.replace(new RegExp(/ /g), "");
    scroll = ((scroll == null) || (scroll == '') || (scroll == 1) || (scroll == '1')) ? 'yes' : 'no';
    resize = ((resize == null) || (resize == '') || (resize == 1) || (resize == '1')) ? 'yes' : 'no';
    var properties = "toolbar=0,scrollbars=" + scroll + ",location=0,statusbar=1,menubar=0,resizable=" + resize;
    properties += ",width=" + w + ",height=" + h;
    child = window.open(url, wname, properties);
    child.focus();
}