function atidaryk(psl, width, height) 

{		

	var X = screen.width / 2 - width/2;

	var Y = screen.height / 2 - height/2;

	  myWin= open("", "displayWindow", 

				"width="+width+",height="+height+",status=no,toolbar=no,menubar=no,resizable=no,left="+X+",top="+Y+"");  

	  myWin.document.open();  

	  myWin.document.write("<html><head><title>avjazz.com</title></head>");

	  myWin.document.write("<body topmargin=0 leftmargin=0>");

	  myWin.document.write("<a href='javascript:close()'><center><img src="+psl+" border=0></center></a>");  	  

	  myWin.document.write("</body></html>"); 

	  myWin.document.close();  

}

function openWin (fileName, windowName)

{

	var X = screen.width / 2 - 265;

	var Y = screen.height / 2 - 210;

	window.open(fileName,'Contacts','width=530,height=420,left='+X+',top='+Y+',screenX='+X+',screenY='+Y+',directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no');

} 

function openMovie (fileName)

{

	var X = screen.width / 2 - 140;

	var Y = screen.height / 2 - 135;			

	window.open(fileName,'Intro','width=280,height=270,left='+X+',top='+Y+',screenX='+X+',screenY='+Y+',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');

}



function openImage (fileName, windowName)

{

	var X = screen.width / 2 - 400;

	var Y = screen.height / 2 - 400;

	window.open(fileName,'Contacts','width=400,height=400,left='+X+',top='+Y+',screenX='+X+',screenY='+Y+',directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no');

}

var id;
var ok = true;
var artist;
var http;

//xmlhttprequest
function handleHttpResponse() 
{
	if (http.readyState == 4)
	{ 
		document.getElementById('output').innerHTML = http.responseText; 
	}
}
function processPage(page_id)
{
	document.getElementById('output').innerHTML = loading;
	updateList(page_id);
}

var timeout = 300; //kiek lailo laukt
var timer = null; //taimeris laukianti ivykdyti funkcija
var time = null; //fiksuojam laika, kad veliau palygint ar jau praejo tiek kiek reikia

function process ()
{
	if (time != null && new Date () - time >= timeout)
	{
		document.getElementById('output').innerHTML = loading;
		timer = null;
		time = null;
		updateList(1);		
	}
	else //patikrinam jei dar nepraejo reikiamas laiko tarpas, nustatom taimeri is pradziu
	{
		time = new Date ();
		if (timer != null) window.clearTimeout (timer);
		timer = window.setTimeout ("process ()", timeout);
	}
}

function updateList(page_id)
{
	artist = document.getElementById("artist").value;
	album = document.getElementById("album").value; 
	
	http = getHTTPObject(); // We create the HTTP Object

	http.open("GET", url + "?artist="+artist+"&album="+album+"&page_id="+page_id + "&lng=" + lng, true); 
	http.onreadystatechange = handleHttpResponse; 
	http.send(null);
 }

function getHTTPObject()
{

  var xmlhttp;

  /*@cc_on

  @if (@_jscript_version >= 5)

    try {

      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {

        xmlhttp = false;

      }

    }

  @else

  xmlhttp = false;

  @end @*/

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

    try {

      xmlhttp = new XMLHttpRequest();

    } catch (e) {

      xmlhttp = false;

    }

  }

  return xmlhttp;

}