<!--

// ---------------------------------------------------------------------------------------

var cookie_name = "";
var cookie_email = "";
var cookie_pairs = document.cookie.split(";");

for (var f=0; f < cookie_pairs.length; f++) {
  var cookie_pairs_split = cookie_pairs[f].split("=");
  if (cookie_pairs_split[0] == " webnews_pro_username" || cookie_pairs_split[0] == "webnews_pro_username") {
    cookie_name = cookie_pairs_split[1];
  }
  if (cookie_pairs_split[0] == " webnews_pro_useremail" || cookie_pairs_split[0] == "webnews_pro_useremail") {
    cookie_email = cookie_pairs_split[1];
  }
}

// ---------------------------------------------------------------------------------------

function cookie_send_mail_set() {
  var n = document.send_mail.form_name.value;
  var e = document.send_mail.form_email.value;

  if (n != "") {
    document.cookie = "webnews_pro_username=" + n + ";expires=Thursday, 31-Dec-2099 12:00:00 GMT; domain=" + document.domain + "; path=/";
  }
  if (e != "") {
    document.cookie = "webnews_pro_useremail=" + e + ";expires=Thursday, 31-Dec-2099 12:00:00 GMT; domain=" + document.domain + "; path=/";
  }
}

// ---------------------------------------------------------------------------------------
// show background
// ---------------------------------------------------------------------------------------

function show_texture(fname) {
  msgWindow = window.open("","","menubar=no,scrollbars=no,resizable=yes,status=no,width=480,height=320");

  msgWindow.document.write("<HTML>");
  msgWindow.document.write("<HEAD>");
  msgWindow.document.write("<TITLE>WebGround - " + fname + "</TITLE>");
  msgWindow.document.write("<LINK REL='stylesheet' TYPE='text/css' HREF='../template/default.css' TITLE='Default'>");
  msgWindow.document.write("</HEAD>");

  msgWindow.document.write("<BODY BGCOLOR=#FFFFFF BACKGROUND='textures/" + fname + "'>");

  msgWindow.document.write("<CENTER>");

  msgWindow.document.write("<SPAN CLASS='default-window-text-black'>");
  msgWindow.document.write("The quick <B>black</B><BR>browser jumps over<BR>the lazy texture.");
  msgWindow.document.write("</SPAN>");
  msgWindow.document.write("<BR><BR>");
  msgWindow.document.write("<SPAN CLASS='default-window-text-white'>");
  msgWindow.document.write("The quick <B>white</B><BR>browser jumps over<BR>the lazy texture.");
  msgWindow.document.write("</SPAN>");
  msgWindow.document.write("<BR><BR>");
  msgWindow.document.write("<SPAN CLASS='default-window-text-red'>");
  msgWindow.document.write("The quick <B>red</B><BR>browser jumps over<BR>the lazy texture.");
  msgWindow.document.write("</SPAN>");
  msgWindow.document.write("<BR><BR>");
  msgWindow.document.write("<SPAN CLASS='default-window-text-green'>");
  msgWindow.document.write("The quick <B>green</B><BR>browser jumps over<BR>the lazy texture.");
  msgWindow.document.write("</SPAN>");
  msgWindow.document.write("<BR><BR>");
  msgWindow.document.write("<SPAN CLASS='default-window-text-blue'>");
  msgWindow.document.write("The quick <B>blue</B><BR>browser jumps over<BR>the lazy texture.");
  msgWindow.document.write("</SPAN>");

  msgWindow.document.write("</CENTER>");

  msgWindow.document.write("</BODY>");
  msgWindow.document.write("</HTML>");
}

function FloatPicture(fname, x, y) {
  win_x = x + 30;
  win_y = y + 30;
  win_features = "menubar=no,scrollbars=no,resizable=no,status=no,width=" + win_x + ",height=" + win_y;

  msgWindow=window.open("","",win_features);
  msgWindow.document.write("<HTML>");
  msgWindow.document.write("<HEAD>");
  msgWindow.document.write("<TITLE>WebGround</TITLE>");
  msgWindow.document.write("</HEAD>");
  msgWindow.document.write("<BODY BGCOLOR=#FFFFFF>");

  msgWindow.document.write("<CENTER>");
  msgWindow.document.write("<IMG ALT='' SRC='" + fname + "' WIDTH=" + x + " HEIGHT=" + y + "><P>");
  msgWindow.document.write("</CENTER>");

  msgWindow.document.write("</BODY>");
  msgWindow.document.write("</HTML>");
}

function WindowStatus(fname) {
  window.status = "http://www.josedealmeida.com/webground/" + fname;
}

// ---------------------------------------------------------------------------------------
// highlight table cells
// ---------------------------------------------------------------------------------------

var bg_change_original;

function bg_change(highlightcolor) {
  source = event.srcElement;
  if (source.tagName == "TR" || source.tagName == "TABLE") {
    return;
  }
  while (source.tagName != "TD") {
    source = source.parentElement;
  }
  if (source.style.backgroundColor != highlightcolor && source.id != "ignore") {
    bg_change_original = source.style.backgroundColor;
    source.style.backgroundColor = highlightcolor;
  }
}

function bg_change_back(sss) {
  if (event.fromElement.contains(event.toElement) || source.contains(event.toElement) || source.id == "ignore") {
    return;
  }
  if (event.toElement != source) {
    source.style.backgroundColor = bg_change_original;
  }
}

// -->

