function popup(url,target,widthorsettings,height) {
var win = null;
  if(arguments.length > 2) {
    var settings = widthorsettings;
      if (arguments.length == 4)
        settings='scrollbars=yes,resizable=yes,status=no,toolbar=no,location=no,menu=no,width='+widthorsettings+',height='+height;
        win=window.open(url,target,settings);
  }

  if(arguments.length == 2) {
    win=window.open(url,target);
  }

  if(arguments.length == 1) {
    win=window.open(url);
  }

  if(win != null) {
    last_popup=win;
    ispopup=true;
    //setfocus(win);
  }
}

function terms() {
  popup ('terms.html','disclaimers','toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=440,height=460');
}

function privacy() {
  popup ('privacy.html','disclaimers','toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=440,height=460');
}

/* this is to set a maxlength for textareas.  it invalidates keystrokes after a length */
function imposeMaxLength(Object, MaxLen)
{
  if(Object.value.length > MaxLen)
  {
    Object.value = Object.value.substring(0, MaxLen);
  }
}

function J$(eleID){ return document.getElementById(eleID);}

//mouseovers for buttons. currently being used on contest page. can be used across if needed.
var bu_ftc_sbtn1 = new Image(); bu_ftc_sbtn1.src="/img/fuelthechange/bu_submitEntry.gif";
var bd_ftc_sbtn1 = new Image(); bd_ftc_sbtn1.src="/img/fuelthechange/bd_submitEntry.gif";

var bu_ftc_pbtn1 = new Image(); bu_ftc_pbtn1.src="/img/fuelthechange/bu_prev.gif";
var bd_ftc_pbtn1 = new Image(); bd_ftc_pbtn1.src="/img/fuelthechange/bd_prev.gif";

var bu_ftc_abtn1 = new Image(); bu_ftc_abtn1.src="/img/fuelthechange/bu_next.gif";
var bd_ftc_abtn1 = new Image(); bd_ftc_abtn1.src="/img/fuelthechange/bd_next.gif";


function takeMouseOver(id,whitelabel){getObj(id).src=eval("bd_"+whitelabel+"_"+id).src;}
function takeMouseOut(id,whitelabel){getObj(id).src=eval("bu_"+whitelabel+"_"+id).src;}