// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

// Depends on JQuery

function select_tab(tabs_div_id, selected_tab_div_id) {
  jQuery("#" + tabs_div_id + " > .tab").removeClass("selected");
  jQuery("#" + selected_tab_div_id).addClass("selected");
}

function getDocumentWidth()
{
  if (document.width) {
    return document.width;
  } else {
    return window.innerWidth - 16;
  }
}

function confirmMe(string) {
    var answer = confirm(string)
    if (answer) {
        return true;
    } else {
        return false;
    }
}

function attachFaceLinkListeners(randomNum) {
    jQuery("#face-link-base-img-" + randomNum).bind('mouseenter', function() {
        jQuery("#face-link-over-img-" + randomNum).show();
        jQuery("#face-link-container-" + randomNum).css({"position" : "relative"});
    });

    jQuery("#face-link-over-img-" + randomNum).bind('mouseleave', function() {
        jQuery("#face-link-over-img-" + randomNum).hide();
        jQuery("#face-link-container-" + randomNum).css({"position" : ""});
    });
}