function CenteredAlert(string)
	{
  lines = string.split(/\r\n|\r|\n|\nl/) ;
  max = 0 ;
  for(l=0;l<lines.length;l++) if(max<lines[l].length) max = lines[l].length ;
  for(l=0;l<lines.length;l++)
		{
    s = Math.floor((max - lines[l].length) / 2) ;
    r = '' ;
    for(i = 0;i<s;i++) r += ' ' ;
    lines[l] = r + lines[l] + r ;
  	}
  string = lines.join('\n') ;
  alert(string) ;
	}
	
function ChangeClickColor(trid,backclr)
	{		
	if(!trid.clicked)
		{
		trid.style.backgroundColor = '#B1CAFB' ;
		trid.clicked = true ;
		}
	else
		{
		trid.style.backgroundColor = backclr ;
		trid.clicked = false ;
		}
	}
		
function ChangeOverColor(trid)
	{
	if(!trid.clicked) trid.style.backgroundColor = '#fbffec' ;
	}
		
function ChangeOutColor(trid,backclr)
	{
	if(!trid.clicked) trid.style.backgroundColor = backclr ;
	}
	
function ListClicked(lang,boatonly)
	{
	naclick = new Array() ;
	naprice = new Array() ;
	alertMsg = new Array() ;	
	
	alertMsg["cze"] = "NEBYLY VYBRÁNY ALESPOŇ 2 NABÍDKY K POROVNÁNÍ.\nNabídky můžete vybrat kliknutím do řádku s nabídkou, kterou chcete porovnávat." ;
	alertMsg["eng"] = "TWO OR MORE BOATS MUST BE SELECTED FOR COMPARISON.\nTo select boats for comparison click on the line of chosen boat." ;
	
	features = "toolbar=no,scrollbars=yes,location=no,status=no,width=750,height=550,resizable=yes,menubar=no,directories=no,top=5,left=5" ;
	if(document.all.resulttr.length>0) for(i=0;i<document.all.resulttr.length;i++) if(document.all.resulttr[i].clicked) naclick[naclick.length] = document.all.resulttr[i].boaid ;
		
	url = 'compare.php?boaids=' + naclick ;
	if(boatonly) url += '&boatonly=1' ;
	if(naclick.length>1) window.open(url,'compare',features) ;
	//if(naclick.length>1) window.location.href = 'compare.php?speids=' + naclick ;
	else CenteredAlert(alertMsg[lang]) ;
	}
