function createDDMenus() {

    $('body').click( function() {
         $('.drop-down-menu').each(function() { $(this).removeClass('active').children('ul').hide(); });
    }); 
    
     $('.drop-down-menu > a').click(function() {
        var curActive = $(this).parent('li').hasClass('active');
        
        $('.drop-down-menu ul').each(function() {
            if(curActive == false){ $(this).hide().parent('li').removeClass('active'); }
        });
        
        if(curActive == false){
            $(this).parent('li').addClass('active');
            $(this).next('ul').slideDown();
        } else {
            $(this).next('ul').hide().parent('li').removeClass('active');
        }
        return false;
    });
    
    $('#cart_small').click( function() {
        $('#cart_large').animate({
                height: 'toggle'
        }, 500);
        
    });
    $('#cart_large').click( function() {
        $('#cart_large').animate({
                height: 'toggle'
        }, 500);
        
    });
    
    $('#store_q').focus( function() {
        if($(this).val() == "Search the U of S Bookstore") {
            $(this).val("");
         }
        
    });
    
     $('#store_q').blur( function() {
        if($(this).val() == "") {
            $(this).val("Search the U of S Bookstore");
         }
        
    });
        
}

function loadFeature(f) {
    //alert(feature);
    //param = f;
    $('#features-wrapper').html('<p class="loading"><img src="images/loading.gif" alt="Loading..." /></p>');
    var jqxhr = $.ajax({ url: "features.php?feature="+f })
        .error(function() { alert("error"); })
        .complete(function(data) {
                $('#features-wrapper').html(jqxhr.responseText);
                $('#feature-image').fadeIn('slow');
            /*fImg = $('features-wrapper').select('img');
            new Effect.Appear(fImg[0],{
                duration:0.3,
                queue: { position: 'end', scope: 'featurescope' }
                });*/
        });
}
$(document).ready(function() {



    $('.close_loc, .locations_home').click( function() {
        $(this).parent().animate({
                right: '-=764'
        }, 500);
        $(this).parent().css('overflow','hidden');

    });
});

function show_loc_details(det_id) {

        $('#'+det_id).animate({
                right: '+=764'
        }, 500);
        $('#'+det_id).css('overflow','visible');



}

function getParameterByName(name) {
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.href);
  if(results == null)
    return false;
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}


