var _POPUP_FEATURES = 'scrollbars=no,toolbar=0,status=0,location=0';
var w=0;
function raw_popup(url, target, x, y, features) {
  if (isUndef(features)) features = _POPUP_FEATURES;
  target = (isUndef(target)) ? '_blank' : target + '_popup';
  xresnow = x; yresnow = y;
  if (navigator.appVersion.indexOf("Mac")!=-1 && document.all) {
	xresnow-=0; yresnow-=0;
  }
  xl = (screen.availWidth/2)-(xresnow/2); tt = (screen.availHeight/2)-(yresnow/2);
  if (document.all) {
	xresnow += 10;
    w=window.open(url, target, 'width='+xresnow+',height='+yresnow+',left='+xl+',top='+tt + ',' + features);
  } else {
	w=window.open(url, target, 'left='+xl+',top='+tt+',width='+x+',height='+y + ',' + features);
  }
  w.focus();
  return false;
}

function link_popup(src, x, y, features) {
    url = src.getAttribute('href');
	  url += (url.indexOf('?')) ? '&popup=1' : '?popup=1';
    return raw_popup(url, src.getAttribute('target') || '_blank', x, y, features);
}
function filmnetwork_popup(src, x, y, features) {
    return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', x, y, features);
}

function isUndef(v) {
    var undef;
    return v===undef;
}

// No default JS file, so adding this here.
function mt(part1, part2, subject, body) {
  location.href = 'mailto:' + part1 + '@' + part2 + '?subject=' + subject + '&body=' + body;
}

$(function() {
  $('.fld_billing_state').dependsOn({
    '#submissions_billing_country' : ':[value~=US]'
  });
});
