var banners=new Array();
var prior_array = new Array();

function fillWindow(window, content, url, data)
{
	window.document.write(
	'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'
+'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
+'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'
 +' <head>'
    +'<title>Printing</title>'
   +' <meta name="robots" content="noindex"></meta>'
   +'<meta name="Generator" content="CMS Made Simple - Copyright (C) 2004-6 Ted Kulp. All rights reserved." />'
    +'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'
+'<link rel="stylesheet" type="text/css" href="print_template.css" />'
  +'</head>'
  +'<body	style="background-color: white; color: black; background-image: none; text-align: left;width: 595px;" >'	
+'<img src="images/tuv_logo_small.jpg" alt="logo"/>'
+'<hr style="border: 1px solid #0062a6;"/>'
+'<p>'
+'<b>Adresas:</b>&nbsp;<a href="http://'+url+'">'+url+'</a></p>'
+'<br/>'


+content
+'<br/><br/><br/><br/><br/><br/>'
+'<div >'
+'<p><b>Data:</b> '+data+'</p>'
+'<p><b>Adresas:</b>&nbsp;<a href="http://'+url+'">'+url+'</a></p><br/>'
+'</div></body></html>');
	
/*el = window.document.createElement('b');
el1 = window.document.createTextNode('Hoho');
el.appendChild(el1);
window.document.body.appendChild(el);	*/
}

function createBaner(html_text, showing_time,index,prioritetas)
{
this.text = html_text;
this.stime = showing_time;
banners[index]= this;

tmp_index = prior_array.length;
for (i = 0; i < prioritetas; i++)
	prior_array[i + tmp_index] = index;
	


}

function showBanner() {
var rand_index = Math.ceil(Math.random()*100000)%prior_array.length;
//alert(rand_no);

//alert(prior_array.length);
document.getElementById('banner_block').innerHTML = banners[prior_array[rand_index]].text;
//alert("ttt")
setTimeout('showBanner()', banners[prior_array[rand_index]].stime*1000);
}

function showBanner2() {
var rand_index = Math.ceil(Math.random()*100000)%prior_array.length;
//alert(rand_no);

//alert(prior_array.length);
document.getElementById('banner_block').innerHTML = banners[prior_array[rand_index]].text;
//alert("ttt")

}