//________________________________________________________
// ROLL OVER
//________________________________________________________

function rollOver(pic, state) {

  if (state) {
    re = /Off.gif/;
    str = "On.gif";

  } else {
    re = /On.gif/;
    str = "Off.gif";
  }

  oldSrc = document.images[pic].src;
  document.images[pic].src = oldSrc.replace(re, str);
}

function cardRollOver(num, re, str) {

  var pos = new Array("left", "up", "right", "bottom");

  for(var i = 0 ; i < pos.length ; i++) {

    oldSrc = document.images[pos[i]+num].src;
    document.images[pos[i]+num].src = oldSrc.replace(re, str);
  }
}


//________________________________________________________
// CHECK
//________________________________________________________

function checkEmail(email) {

  var check = false;
  var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;

  if (re.test(email))
    check = true;

  return check;
}

function onlyNum(str) {

  var check = false;
  var re = /^[0-9]+$/;

  if (re.test(str))
    check = true;

  return check;
}

function msgPopup(msg) {
  msgToPopup = msg;
  wo = window.open('popup.html','','toolbar = no, width = 225, height = 125');
  wo.focus();
}
