Dialog = {};

Dialog.open = function(_message, _type)
{
	var winl = (screen.width-400)/2;
  	var wint = (screen.height-300)/2;
	
	var d = Dialog;
	if(d.type != _type)
	{
		if(d.type != null) { d.close(); }
		d.type = _type;
		
		d.w = document.createElement('div');
		d.w.id = 'dialog';
		document.body.appendChild(d.w);
		d.w.style.left=winl;
		d.w.style.top=wint;
		
		var header = document.createElement('div');
		header.id = 'header';
		header.className = _type;
		d.w.appendChild(header);
		
		/*
		var exit = document.createElement('div');
		exit.id = 'exit';
		exit.innerHTML = '[x]';
		exit.onclick = function() { Dialog.close(); };
		header.appendChild(exit);
		*/
		d.w.message = document.createElement('div');
		d.w.message.id = 'message';
		d.w.appendChild(d.w.message);
	}
	d.w.message.innerHTML += _message +"<br />";
}

Dialog.close = function()
{
	document.body.removeChild(Dialog.w);
	Dialog.type = null;
}

function suwakGo(wrapper,contentlayer) {
  var wndo = new sBar(wrapper, contentlayer);
  wndo.setUpScrollbar("dragBar", "track", "v", 1, 1);
  sBar.korektaFire(wrapper); 
}

function send_to_friend()
{
	var winl = (screen.width-500)/2;
  	var wint = (screen.height-500)/2;
	var okn = window.open('send-friend.asp','SendFriend','left='+winl+',top='+wint+',width=500,height=300');
	okn.focus();
}

function showindow(url)
{   
   	var w=1014;
   	var h=675;
   	var winl = (screen.width-w)/2;
  	var wint = (screen.height-h)/2;
   	var t='location=no,toolbar=no,directories=no,menubar=yes,resizable=no,scrollbars=no,status=no,width='+w+',height='+h+',left='+winl+',top='+wint;

   	now = new Date();
    sec = now.getSeconds(); 
    sec = sec+""+now.getMinutes();
    namex="okno"+sec;
   	
   	nowe_okienko=window.open(url,namex,t);
   	nowe_okienko.focus();
}