<!--//

function pause(millisecondi)
{
    var now = new Date();
    var exitTime = now.getTime() + millisecondi;

    while(true)
    {
        now = new Date();
        if(now.getTime() > exitTime) return;
    }
}


function send()
{
	if (document.szukaj.kategoria.value == 'g')
	{
		document.szukaj.action="http://www.kobiety.net.pl/google.php";
		document.szukaj.method='GET';
	}
	else 
	{
		document.szukaj.action="http://www.kobiety.net.pl/search.php"
	}

	document.szukaj.submit()
}

function openWithSelfMain(url,name,width,height,returnwindow) 
{
	var options = "width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";
	var new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
	if (returnwindow != null) {
	   return new_window;
	}
}

function fromCode(val)
{
	var i;
	var codes=new Array(230,198,177,161,182,166,234,202,179,163,243,211,188,172,191,175,241,209);
	var letters=new Array('æ','Æ','±','¡','¶','¦','ê','Ê','³','£','ó','Ó','¼','¬','¿','¯','ñ','Ñ');

	for (i=0; i < codes.length; i++)
	{
		if (codes[i] == val)
			return(letters[i]);
	}
	return(String.fromCharCode(val));
}

function decode(str)
{
	var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
	var result='';
	var a1,a2,a3,a4;
	var b1,b2,b3,b4;

	for (i=0; i < str.length; i += 4)
	{	
		a1=t.indexOf(str.charAt(i));
		a2=t.indexOf(str.charAt(i+1));
		a3=t.indexOf(str.charAt(i+2));
		a4=t.indexOf(str.charAt(i+3));
		b1 = (a1 << 2) | (a2 >> 4);
		b2 = ((a2 & 15) << 4) | (a3 >> 2);
		b3 = ((a3 & 3) << 6) | a4;
		result += fromCode(b1);
		if (a3 != 64)
			result += fromCode(b2);
		if (a4 != 64)
			result += fromCode(b3);
	}
	//result = base64_encode(result);
	return(result);
}

function d(arg)
{
	document.write(decode(arg));
}

function eg(arg)
{
	document.write(decode(arg));
}

function report_problem()
{
	window.open('http://www.kobiety.net.pl/error.php','report','height=500,width=376,toolbar=no,scrollbars=no,directories=no,menubar=no,location=no,status=no');
}

function report_forum(id)
{
	window.open('http://www.kobiety.net.pl/forum_error.php?postid=' + id,'report','height=300,width=376,toolbar=no,scrollbars=no,directories=no,menubar=no,location=no,status=no');
}

function poll_result(id)
{
	
	window.open('http://www.kobiety.net.pl/poll.php?mode=results&pollid=' + id,'Ankieta','height=300,width=450,toolbar=no,scrollbars=no,directories=no,menubar=no,location=no,status=no');
}

function vote()
{
	var form = document.getElementById('poll');
	//form.action = 'poll.php';
	//form.target = 'new';
	//form.submit;
	//alert (form.pollid.value);
	var pollid = form.pollid.value;
	var fe = form.elements;
	for (i = 0; i<fe.length; i++) {
		if ((fe[i].type == "radio") && fe[i].checked) {
			var radioval = fe[i].value;
		}
	}

    window.open('http://www.kobiety.net.pl/poll.php?do=pollvote&pollid= '+pollid+'&optionnumber='+radioval,'Ankieta','height=300,width=415,toolbar=no,scrollbars=no,directories=no,menubar=no,location=no,status=no');
	document.reload();
}



function mail_friend(id, url)
{
	var url_end = 'http://www.kobiety.net.pl/mail.php?id=' + id + '&url=' + url;
	window.open(url_end,'Powiadom','height=600,width=376,toolbar=no,directories=no,menubar=no,location=no,status=no');
}

function get_link(id, url)
{
	var url_end = 'http://www.kobiety.net.pl/link.php?id=' + id + '&url=' + url;
	window.open(url_end, 'Linkuj','height=600,width=376,toolbar=no,directories=no,menubar=no,location=no,status=no');
}
function open_zast()
{
	var url_end = 'http://www.kobiety.net.pl/zastrzezenia.html';
	window.open(url_end, 'Zastrzezenia','height=600,width=376,toolbar=no,directories=no,menubar=no,location=no,status=no');
}


function show_link()
	{
		var lancuch='http://news.senior.pl/rss,';

		if(document.forms.generator.zdrowie.checked)
			lancuch += 'zdrowie,';
		if(document.forms.generator.rodzina.checked)
			lancuch += 'rodzina,';
		if(document.forms.generator.finanse.checked)
			lancuch += 'finanse,';
		if(document.forms.generator.praca.checked)
			lancuch += 'praca,';
		if(document.forms.generator.pasje.checked)
			lancuch += 'pasje,';
		if(document.forms.generator.edukacja.checked)
			lancuch += 'edukacja,';
		if(document.forms.generator.plus.checked)
			lancuch += '50plus,';
		if(document.forms.generator.recenzje.checked)
			lancuch += 'recenzje,';
		
		if(lancuch == 'http://news.senior.pl/rss,')
		{
			alert('Musisz zaznaczyæ jedn± z kategorii');
			document.forms.generator.s_i.focus();
			return (false);
		}

		if(document.forms.generator.age.value)
			lancuch += document.forms.generator.age.value + ',';
		if(document.forms.generator.limit.value > 0)
			lancuch += document.forms.generator.limit.value;

		lancuch += '.xml';

		document.forms.generator.source.value =  lancuch;
	}

	function copy_to_clipboard()
	{
		var txt;
		txt = document.forms.generator.source.innerText;
		window.clipboardData.setData('Text', txt);
		document.forms.generator.source.focus();
		document.forms.generator.source.select();
	}

	function insertIt() 
	{
		//var _x = document.getElementById('framepoll');
		//var _z = _x.scrollWidth;
		//alert(_x.height);
		//x.scrollWidth = 300;
		//_y.innerHTML = _z;
	} 





//-->