function muudaKommentaariKastiSisu(adre) {
  //alert ('adre='+adre);
   //
  var raamike = document.getElementById("comments");
  //var aadressike = 'index.php?lk_id=20'+adre;
  var aadressike = 'index.php?lk_id=20&pid='+adre;
  if (raamike) {
    raamike.src = aadressike;
  }
  
}
//
function kontrolliks (muutuja)
{
	alert ("mis toimub mis tahad ah "+muutuja);
}
function pollHash ()
{
	
	handleHistory ();
	window.setInterval ("handleHistory()", 1000);
	return true;
}
//

//
function handleHistory ()
{
	//alert("window.location.hash" + window.location.hash + "\nexpectedHash " + expectedHash);
	//alert('window.locat '+window.location.hash);
  //alert('expectedHash '+expectedHash);
	if (window.location.hash != expectedHash )
	{
		
		var hashipaarid = window.location.hash.split ('=');
		var uuePildiTegelikId = hashipaarid [hashipaarid.length - 1];
		//paneUusPildiId(uuePildiTegelikId);
		//alert('uuePildiTegelikId '+uuePildiTegelikId);
		//alert('hashipaarid[hashipaarid.length-1] '+hashipaarid[hashipaarid.length-1]);
		
		//var miskiArray[] = uuePildiTegelikId;
		//alert("window.location.hash" + window.location.hash + "\nexpectedHash " + expectedHash);
		//
		expectedHash = window.location.hash;
		
		//buttonHandler('getImg', [uuePildiTegelikId]);
		// flashProxy.call('_root.buttonHandler', 'getImg', [uuePildiTegelikId]);
		////
		//
		//
		//flashProxy.call('misTahad', 'prev');
		//
		///
		////
		//runTestCode();
		//location.reload();
		//var newoption = expectedHash.substring(6);
		//setOptionValue( newoption );
		
	}
	return true;
}
//
function getIdFromQstring ()
{
	//Retrieve Document location and tear off the QueryString values for processing.
	var url = document.location + '';
	q = url.split ('?');
	if (q [1])
	{
		//Get all Name/Value pairs from the QueryString
		var pairs = q [1].split ('&');
		for (i = 0; i < pairs.length; i ++)
		{
			//Get the Name from given Name/Value pair
			var keyval = pairs [i].split ('=');
			if (keyval [0] == 'pid')
			{
				//Get the Value from given Name/Value pair and set to the return ID
				var squareid = keyval [1];
			}
			//
			if (keyval [2] == 'pid')
			{
				//Get the Value from given Name/Value pair and set to the return ID
				var squareid = keyval [3];
			}
		}
	}
	if (squareid)
	{
		return "&amp;pid=" + squareid;
	} else 
	{
		return "&amp;ppp=0";
	}
}
//
//
function getPidFromQstring ()
{
	//Retrieve Document location and tear off the QueryString values for processing.
	var url = document.location + '';
	q = url.split ('?');
	if (q [1])
	{
		//Get all Name/Value pairs from the QueryString
		var pairs = q [1].split ('&');
		for (i = 0; i < pairs.length; i ++)
		{
			//Get the Name from given Name/Value pair
			var keyval = pairs [i].split ('=');
			if (keyval [0] == 'pid')
			{
				//Get the Value from given Name/Value pair and set to the return ID
				var squareid = keyval [1];
			}
			//
			if (keyval [2] == 'pid')
			{
				//Get the Value from given Name/Value pair and set to the return ID
				var squareid = keyval [3];
			}
		}
	}
	if (squareid)
	{
		return squareid;
	} else {
    return false;
  }
}
//
function getGidFromQstring ()
{
	//Retrieve Document location and tear off the QueryString values for processing.
	var url = document.location + '';
	q = url.split ('?');
	if (q [1])
	{
		//Get all Name/Value pairs from the QueryString
		var pairs = q [1].split ('&');
		for (i = 0; i < pairs.length; i ++)
		{
			//Get the Name from given Name/Value pair
			var keyval = pairs [i].split ('=');
			if (keyval [0] == 'gid')
			{
				//Get the Value from given Name/Value pair and set to the return ID
				var squareid = keyval [1];
			}
			//
			if (keyval [2] == 'gid')
			{
				//Get the Value from given Name/Value pair and set to the return ID
				var squareid = keyval [3];
			}
		}
	}
	if (squareid)
	{
		return squareid;
	} else 
	{
		return false;
	}
}
