$(document).ready(function(){
    $(".quiklinks .links").click(function () { 
        $(".quiklinks .box").slideToggle(); 
    });
    $(".toplinks").mouseover(function(){
	$(this).addClass("toplinks_hover");
    });
    $(".toplinks").mouseout(function(){
        $(this).removeClass("toplinks_hover");
    });
function kc (e) {
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    if(keycode == 13){
    void(0);
    }
}


var $greets = $('#greeetings');//we'll re use it a lot, so better save it to a var.
$greets.serialScroll({
	items:'img',
	duration:5000,
	force:true,
	axis:'x',
	easing:'linear',
	lazy:true,// NOTE: it's set to true, meaning you can add/remove/reorder items and the changes are taken into account.
	interval:1, // yeah! I now added auto-scrolling
	step:1 // scroll 2 news each time
});

valcheck = {
   all : function(param,e) {
       console.log(param)
        var tparam = $.trim(param);
        var len = tparam.length;
        if (e.keyCode == 32 || (65 <= e.keyCode && e.keyCode <= 65 + 25) || (97 <= e.keyCode && e.keyCode <= 97 + 25) || (e.keyCode == 8)) {
            if ( len >=3 ) {
                $.ajax({
                    type: "GET",
                    url: "/check.php",
                    data: 'search='+tparam,
                    success: function(msg){
                        $("#return").html(msg);
                        if (msg != '') {
                            if ( $("#return").css('display') == "none" )  {
	                            $("#return").effect("slide", {direction: "up"}, 500);

                            }
                        }
                    },
                    failure: function(msg){
                        alert( "sorry we are having some strange difficulties. the admin has been notified" );
                    }
                })
            } else if (tparam == '') {
                $("#return").hide();
            }
        }
    },
    submit : function(param) {
        $("#search_form").submit();
    },
    cpme : function (param) {
        var vale = $("#"+param).html();
        $("#search").val(vale);
        $("#return").hide("slide",{direction: "up"}, 500);
    },
    city : function() {
        alert("city");
    },
    state : function() {
        alert("state");
    },
    zip : function() {
        alert("zip");
    }
}

});

