﻿/// <reference path="jquery-1.3.2-vsdoc2.js" />


$(function() {
    // main menu
$("div.menu > ul > li").mouseover(function() {
        if ($(this).children("ul").children().size() >= 1) { //IE6 fix to not display if no li children
            $(this).find("ul").fadeIn(200);
            $(this).find("a:first").addClass("open");
        }
    }).mouseleave(function() {
        $(this).find("ul").fadeOut(200);
        $(this).find("a:first").removeClass("open");
    });

    // search form
    $("div.header_bottom div.form input").focus(function() {
        var input = $(this);
        if (input.val() == "SEARCH") {
            input.val("");
        }
    }).keypress(function(e) {
        if (e.which == 13) {
            $(this).next().click();
            return false;
        }
    });

    $("div.header_bottom div.form a").click(function() {
        var a = $(this);
        document.location = a.attr("href") + escape(a.prev().val());
        return false;
    });

    // ad refresh
    if (refreshAdSeconds > 0) {
        setInterval(function() { refreshAd(); }, refreshAdSeconds * 1000);
    }
});