// UTF8 test: áéíóöőúüűÁÉÍÓÖŐÚÜŰ
function music(_music) {
  if ( document.getElementById('musicdiv').innerHTML != '' ) {
    document.getElementById('musicdiv').innerHTML = '';
    document.getElementById('musicimg').src = 'WSite/images/music_off.png';
  } else {
    document.getElementById('musicdiv').innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" width="0" height="0" id="music" align="middle">' + "\n" +
                                                    '  <param name="allowScriptAccess" value="sameDomain" />' + "\n" +
                                                    '  <param name="movie" value="userfiles/' + _music + '.swf" />' + "\n" +
                                                    '  <param name="quality" value="high" />' + "\n" +
                                                    '  <param name="bgcolor" value="#666666" />' + "\n" +
                                                    '  <param name="loop" value="true" />' + "\n" +
                                                    '  <embed src="userfiles/' + _music + '.swf" quality="high" bgcolor="#666666" width="0" height="0" name="music" align="middle" allowScriptAccess="" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" loop="true" />' + "\n" +
                                                    '</object>' + "\n";
    document.getElementById('musicimg').src = 'WSite/images/music_on.png';
  }
}

function positioning() {
  window.parent.document.getElementById('contentframe').style.height = window.document.getElementById('contentheight').offsetHeight;
}

var TMPHEIGHT = 0;

function frameHeight(_iframe) {
  _iframe.parent.document.getElementById('contentframe').style.height = 0;
  if (_iframe.document.getElementById('contentheight').offsetHeight > _iframe.parent.document.getElementById('contentframe').offsetHeight)
    _iframe.parent.document.getElementById('contentframe').style.height = _iframe.document.getElementById('contentheight').offsetHeight;
}

function disableSelection() {
  document.onselectstart = function () { return false; } // ie
  document.onmousedown = function () { return false; } // mozilla
  document.oncontextmenu=new Function("return false");
}

function startScroll(_direction) {
  scroll(_direction);
}

function stopScroll() {
  clearTimeout(t);
}

function scroll(_direction) {
  var speed = 2;
  var div = document.getElementById('thumbnails');
  if ( div.scrollLeft != 0 && _direction == "left" ) {
    div.scrollLeft -= speed;
  } else if ( div.scrollLeft != div.scrollWidth && _direction == "right" ) {
    div.scrollLeft += speed;
  } else if ( div.scrollTop != 0 && _direction == "down" ) {
    div.scrollTop -= speed;
  } else if ( div.scrollTop != div.scrollHeight && _direction == "up" ) {
    div.scrollTop += speed;
  }
  t = setTimeout("scroll(\"" + _direction + "\")", 10);
}

function openImage(_src) {
  var img = document.getElementById('image').getElementsByTagName('img');
  img[0].src = _src;
}

