var vChk = false;

function link(url)
{
	window.location = url;
}

function t20link(url)
{
	if(vChk)
	{
		vChk = false;
	}
	else
	{
		window.location = url;
	}
}

function vote(id,vote,ext)
{
	$.getJSON("ajax-vote,"+id+","+vote+".html",
		function(data){
			if(ext)
			{
				$("#vote"+id+" .yesv").html('Jest OK: <b>'+data.ret[1]+'</b>');
          	$("#vote"+id+" .nov").html('Nie przepadam: <b>'+data.ret[2]+'</b>');
			}
			else
			{
			 	$("#vote"+id+" .yesv").html(data.ret[1]);
          	$("#vote"+id+" .nov").html(data.ret[2]);

			}
      });
   vChk = true;         
}

function compareValidation(type)
{
	if($("#"+type+"1").val()==0 || $("#"+type+"2").val()==0) {return false;}
	if($("#"+type+"1").val() == $("#"+type+"2").val()) {return false;}
	return true;
}

function switchPhoto(img,id)
{
	//alert(img+' '+psel[id][0]);
	$(img).attr('src','_c/osoby/'+id+'/'+psel[id][0]+',6.jpg');
	$(img).attr('alt',psel[id][2]==''?psel[id][1]+' '+psel[id][2]:psel[id][3]);
}

function showOver(id)
{
	$(".over1").hide();
	$(".over2").hide();
	$(".over3").hide();
	$("#"+id).show();
}

function hideOver(id)
{
	$("#"+id).hide();
}


//reklamy google
var googleChannel = '2090463985'; 
var googleClient  = 'pub-4069369533017132'; 

var slotWidth     = 670; 
var slotHeight    = 250; 
var cntBox        = 4;   
var floating      = 1;   
var slotTop       = false; 

function google_ad_request_done(google_ads)
{
   var s = '';
   var i;
   if (google_ads.length >= 1)
   {
      s += '<div style="clear:both;padding-top: 18px;width:' + slotWidth + 'px;' + (slotTop ? 'margin:0 auto;' : '') + '">';
      s += '<div class="google_fieldset" id="google_adsense">';
      s += '<div class="google_reklama"><a class="ad_header reklamy" style="text-decoration:none;" href=\"' + google_info.feedback_url + '\">Reklamy Google</a></div>'
      s += '<div style="overflow:hidden;">';
      for(i = 0; i < google_ads.length; ++i)
      {
         var cellwidth = parseInt((slotWidth-(cntBox*17))/cntBox);
         s += (floating != 1) ? '<div style="text-align: left; padding: 5px 10px 13px 0px;float:left; width:' + cellwidth + 'px;">' : '<div style="text-align: left; padding: 5px 0px 13px 0px;">';
         s += '<h6 class="ad_line1"><a target="_blank" class="ad_line1" href="' + google_ads[i].url + '" onmouseout="window.status=\'\'" ' +
         'onmouseover="window.status=\'go to ' + google_ads[i].visible_url + '\'">' + 
         google_ads[i].line1 + '</a></h6>' +
         '<div class="ad_text">' +
         google_ads[i].line2 + '&nbsp;'+
         google_ads[i].line3 + '<br></div>' +
         '<a target="_blank" class="ad_url" href="' + google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' + 
         google_ads[i].visible_url + '\'" style="text-decoration:none">' +
         google_ads[i].visible_url + '</a></div>';
      }
      s += '</div>';
      s += '</div>';
      s += '</div>';
   }
   document.write(s);
   return;
}

google_ad_client   = googleClient;
google_ad_width    = slotWidth;
google_ad_height   = slotHeight;
google_ad_format   = '' + slotWidth + 'x' + slotHeight + '_as';
google_ad_type     = "text_image";
google_ad_channel  = googleChannel;
google_ui_features = "rc:0";
google_ad_output   = 'js';
google_max_num_ads = cntBox;
google_min_num_ads = cntBox;
google_feedback    = 'on';