// Javascript Document

var _POPUP_FEATURES = 'location=0, statusbar=0, menubar=0, width=400, height=300';

function unpaid(elem, text, id) {
    elem.innerHTML = text;
    trackPhone(id);
}

function setManageCat(catId) {
	window.location.href = 'manage-vendor-pages?do=manage&catid='+catId;
	return false;
}

function trackPhone(id) {
    var url = '/ajax/track-unpaid-phone/?id='+id;

    new Ajax.Request(url);
}

window.onload = function() {
    var factId = $('incorrect-fact').innerHTML;
    $('incorrect-fact').innerHTML = '<a href="mailto:seocontactus@gmail.com?subject=Incorrect Fact in '+factId+ '" class="hover-only">Contact us if this fact is wrong.</a>';

}

function raw_popup(url, target, features) {
  if (isUndefined(features)) {
    features = _POPUP_FEATURES;
  }
  if (isUndefined(target)) {
    target = '_blank';
  }
  var theWindow =
    window.open(url, target, features);
  theWindow.focus();
  return theWindow;
}
