function hide() {
document.getElementById('styled_popup').style.display='block';
document.getElementById("captionRow1").style.display = 'none';
document.getElementById("captionRow2").style.display = 'none';
document.getElementById("captionRow3").style.display = 'none';
document.getElementById("captionRow4").style.display = 'none';
document.getElementById("captionRow5").style.display = 'none';
document.getElementById("captionRow6").style.display = 'none';
document.getElementById("captionRow7").style.display = 'none';
document.getElementById("captionRow8").style.display = 'none';
document.getElementById("captionRow9").style.display = 'none';
document.getElementById("captionRow10").style.display = 'none';
document.getElementById("captionRow11").style.display = 'none';
document.getElementById("captionRow12").style.display = 'none';
document.getElementById("captionRow13").style.display = 'none';
document.getElementById("captionRow14").style.display = 'none';
document.getElementById("captionRow15").style.display = 'none';
}

var ie = document.all;
var nn6 = document.getElementById &&! document.all;

var isdrag = false;
var x, y;
var dobj;

function movemouse( e ) {
  if( isdrag ) {
    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
    return false;
  }
}

function selectmouse( e ) {
  var fobj       = nn6 ? e.target : event.srcElement;
  var topelement = nn6 ? "HTML" : "BODY";

  while (fobj.tagName != topelement && fobj.className != "dragme") {
    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
  }

  if (fobj.className=="dragme") {
    isdrag = true;
    dobj = document.getElementById("styled_popup");
    tx = parseInt(dobj.style.left+0);
    ty = parseInt(dobj.style.top+0);
    x = nn6 ? e.clientX : event.clientX;
    y = nn6 ? e.clientY : event.clientY;
    document.onmousemove=movemouse;
    return false;
  }
}

function styledPopupClose() {
  document.getElementById("styled_popup").style.display = "none";
}

document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");

function init() {

}
 
function displayRow(foo) {
	var table = document.getElementById("captionRow"+foo); 
	if (table.style.display == '')  table.style.display = 'none';
	else table.style.display = '';
}
 
function loadXMLDoc(url)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('vasen').innerHTML=xmlhttp.responseText;
}
 
function admin(url)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('alapalkki').innerHTML=xmlhttp.responseText;
}

if (document.images) {
 img_on =new Image();  img_on.src ="../dark/ylapalkki_over.png"; 
 img_off=new Image();  img_off.src="../dark/ylapalkki.png"; 
}

function handleOver() { 
 if (document.images) document.ylapalkkikuva.src=img_on.src;
}

function handleOut() {
 if (document.images) document.ylapalkkikuva.src=img_off.src;
}

function doClear(theText) {
     if (theText.value == theText.defaultValue) {
         theText.value = ""
     }
 }
