var pre1 = new Image();
var pre2 = new Image();
var pre3 = new Image();
var pre4 = new Image();
var pre5 = new Image();
var pre6 = new Image();
var pre7 = new Image();
 
pre1.src = "images/menu1_.gif";
pre2.src = "images/menu2_.gif";
pre3.src = "images/menu3_.gif";
pre4.src = "images/menu4_.gif";
pre5.src = "images/arrowup_.gif";
pre6.src = "images/arrowdown_.gif";
pre7.src = "images/menu.png";

function preload()
{
 document.write("<div id=\"loading\" style=\"position:absolute;width:9999px;height:9999px;background-color:white;z-index:1000\"></div>\n<div id=\"loadimg\" style=\"position:fixed;left:"+((document.body.clientWidth-159)/2)+"px;top:300px;width:159px;height:10px;background-image:url(images/loading.gif);z-index:1001\">\n<img src=\"images/blank.gif\" width=\"159\" height=\"10\" alt=\"loading\" /></div>\n");
}

function init()
{
 with(document) {
  getElementById("loading").style.display="none";
  getElementById("loadimg").style.display="none";
  getElementById("menuholder").style.display="block";
 }
}

function swap(what, name, id)
{
 if(navigator.appName.indexOf('Opera')<0) {
  what.className=name;
  document.getElementById('m' + id).className=name;
 }
}

var x = true;

function scrollit(where, what)
{
 var y;
 var step = 5;
 var timeout = 25;
 var diff = document.getElementById("content"+what).offsetHeight - document.getElementById("left"+what).offsetHeight + 30;

 with(document) {
  if(where == "down") step = -step;
  if(getElementById("content"+what).style.top == "") y = 0;
  else y = parseInt(getElementById("content"+what).style.top) + step;
  if(-y<diff && y<=0) getElementById("content"+what).style.top = y+"px";
 }
 if(x == true) setTimeout("scrollit('"+where+"', '"+what+"')", timeout);
}

function swfplay(artist, track)
{
 with(document) {
  if(getElementById("player")) {
   getElementById("swfPlayer").innerHTML='\n<embed src="player.swf?ref='+ref+'&playlist='+escape(playlist+'?artist='+artist+'&track='+track+'&autoStart=yes')+'" quality="high" wmode="transparent" width="'+swfwidth+'" height="'+swfheight+'" name="player" id="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n';
  }
 }
}

function checkvalue(what)
{
 if(document.getElementById(what).value == "") alert("empty "+what);
 else document.forms[0].submit();
}

function checkfiltervalue(what)
{
 if(document.getElementById(what).value == "") alert("empty "+what);
 else if (document.getElementById('filter') != null) {
  document.getElementById('filter').value = document.getElementById('filter').value.substring(0, filter);
  document.forms[0].submit();
 }
}