$(document).ready(function() {
	$('#licznik').tooltip({ 
    track: true, 
    delay: 0, 
    showURL: false, 
    showBody: " - ", 
    fade: 250 
	});

});

$(document).ready(function() {
	$('#transfery-box .box-descr').not(":first").hide();
	
	$('#transfery-select').change(function() {
		$('#transfery-box .box-descr').hide();
		$('#transfery-box .box-descr').eq($('#transfery-select').val()).show();
	});
});


$(document).ready(function() {
	$('#menu>li').hover(function() {
		$('#menu li').removeClass('active');
		$(this).addClass('active');
	});
});

function trim(string) {
	return $.trim(string);
}
function isInteger (s) {
	return parseInt(s).toString() == s;
}
function getAJAX(file, div) {

	$.ajax({
		type: "POST",
		url: file,
		data: "ajax=true",
		async: false,
		success: function(msg) {
			$(div).html(msg);
		}
	});
	return false;
}
function sendSonda(formul) {
	if (idOdp = $('input[name=answer]:checked').val())
		$.ajax({
			type: "POST",
			url: '/sonda.php',
			data: "ajax=true&answer=" + idOdp,
			async: false,
			success: function(msg) {
				$('#sondaDiv').html(msg);
			}
		});
	return false;
}

function sendSonda2(formul) {
	if (idOdp = $('input[name=answer]:checked').val())
		$.ajax({
			type: "POST",
			url: '/sonda2.php',
			data: "ajax=true&answer=" + idOdp,
			async: false,
			success: function(msg) {
				$('#sondaDiv').html(msg);
			}
		});
	return false;
}

function SendShout(formul) {
	$.ajax({
		type: "POST",
		url: '/shoutbox.php',
		data: "ajax=true&shoutval=" + $('#shtr').val(),
		async: false,
		success: function(msg) {
			$('#shoutboxDiv').html(msg);
		}
	});
	return false;
}

function SendShout2(formul) {
	$.ajax({
		type: "POST",
		url: '/shoutbox_n.php',
		data: "ajax=true&shoutval=" + $('#shtr').val(),
		async: false,
		success: function(msg) {
			$('#shoutboxDiv').html(msg);
		}
	});
	return false;
}

function pop_up(url,w,h) {
	var Win = window.open(url,"", 'width=' + w + ', height=' + h + ', resizable=0, scrollbars=yes, menubar=no' );	
	Win.focus();
	return false;
	}
	
function userinfo(userid) {
	ret = false;
	$.ajax({
		type: "POST",
		url: '/userinfo.php?i=' + userid,
		data: "ajax=true",
		async: false,
		success: function(msg) {
			if (msg.length > 0) {
				el = $('#overlay');
				if (el.size() == 0)
					el = $('<div id="overlay">')
				el2 = $('#overlayBox');
				if (el2.size() == 0)
					el2 = $('<div id="overlayBox">');
				el3 = $('#overlayMsgDiv');
				if (el3.size() == 0)
					el3 = $('<div id="overlayMsgDiv">');
				$('body').append(el2);
				el2.append(el3);
				el3.html(msg);
				el.show();
				el2.show();
				$('body').append(el);
				el.click(function() {
					el.hide();
					el2.hide();
				});
			}
			else
				ret = true;
		}
	});
	return ret;
}
function hide(element) {
	$('#'+element).hide();
	return false;
}

$(function() {
	// Use this example, or...
	$('.galeria a').lightBox(); 
	
});

function AddEmo(nazwa,emo) {
  	document.getElementById(nazwa).value += emo;
	return false;
	} 

function loadLive() {
	$.ajax({
		type: "POST",
		url: '/live.php',
		data: "ajax=true",
		async: true,
		success: function(msg) {
			$('#live').html(msg);
		}
	});
	setTimeout('loadLive()', 30000);
}
$(document).ready(function() { 
	loadLive();
});


function popwindow(theURL,winName,features) { 
	if (document.all) {
		var sizer = window.open(theURL,winName,"left=0,top=0,width=446,height=400,resizable=yes,scrollbars=yes");
	}
	else
//window.location = website;
	window.open(theURL,winName,"left=0,top=0,width=446,height=400,resizable=yes,scrollbars=yes");
}


function aTarget(el, name) {
   var wnd = window.open(typeof el == 'string' ? el : el.getAttribute('href'), typeof name != 'undefined' ? name : '', 'menubar=yes,toolbar=yes,location=yes,directories=no,status=yes,scrollbars=yes,resizable=yes');
   if (!wnd) return false;
		wnd.focus();
	return false; 
	} 

