<!-- //

function BullStatistic()
{
	var colorDepth = window.screen.colorDepth;
	var res = window.screen.width + "," + window.screen.height;
	var referer = escape(document.referrer);
	document.write('<img src="/statystyka/zlicz.php?colors=' + colorDepth + '&resolution=' + res + '&referer=' + referer + '" style="width:0;height:0;" />');
}

function addBookmark(title,url)
{
	if (window.sidebar)
	{
  		window.sidebar.addPanel(title, url,"");
 	}
	else if( document.all )
	{
 		window.external.AddFavorite( url, title);
 	}
	else if( window.opera && window.print )
	{
 		return true;
	}
}

function HideButton()
{
	jQuery('input:last').attr("disabled","disabled");
}

function HideButton2(id)
{
	jQuery('input:last').attr("disabled","disabled");
	jQuery("#"+id).submit();
}

function addHtmlPart(what,where,txtIndex,strClass)
{

	var index = txtIndex.value;
	var obj = document.createElement('div');
	var strHTML = what.innerHTML;
	var re = /\[n1\]/g;
	obj.innerHTML=strHTML.replace(re,'[n'+(parseInt(index)+1)+']');
	obj.className=strClass;
	where.appendChild(obj);
	
	txtIndex.value = parseInt(txtIndex.value)+1;
}

function WyslijEmail(uzytkownik, domena, temat)
{
	var OtworzProgramPocztowy = "mailto:" + uzytkownik + "@" + domena + "?Subject=" + temat;
	window.location = OtworzProgramPocztowy;
}

function $(id)
{
	return document.getElementById(id);
}

function ShowBookmarks(id)
{
	for(var i = 1; i < 5; i++)
	{
		if(i != id) $('bookmark'+i).style.display="none";
		else $('bookmark'+i).style.display="";
	}
}

function ShowDiv(id)
{
	if($(id).style.display == "none")
	{
		$(id).style.display = "";		
	}
	else
	{
		$(id).style.display = "none";		
	}
	
}

function ShowBookmarks2(id)
{
	for(var i = 1; i < 4; i++)
	{
		if(i != id) $('bookmark'+i).style.display="none";
		else $('bookmark'+i).style.display="";
	}
}

function CheckValidEmail(adres)
{
   a = adres.search(/@/i);
   a1 = adres.substring(0,a);
   a2 = a1.length;
   a = a + 1;
   b = adres.indexOf(".");
   b1 = adres.substring(a,b);
   b2 = b1.length;
   b = b + 1;
   c = adres.length;
   c1 = adres.substring(b,c);
   c2 = c1.length;
   if(adres.indexOf("@") != "-1" && adres.indexOf(".") != "-1" && a2 >= 1 && b2 >= 1 && c2 >= 1)
   {
   	return true;
   }
   else
   {
   	return false;
   }
}

function Print(content,lang)
{
	var okno = null;
	ScrWidth = 640;
	 width = 700;
	ScrHeight = 480;
	height = 480;
	if(window.screen)
	{
		ScrWidth = window.screen.width;
		ScrHeight = window.screen.height;
	}
	if(okno != null && !document.layers)
	{
		okno.close();
	}
	PosX = Math.round((ScrWidth - width) / 2);
	PosY = Math.round((ScrHeight - height) / 2);
	okno = window.open("/print.php?content="+content+"&lang="+lang, "aktualnosci", "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
	okno.focus();
}

function Newsletter(lang,newsletter_action,msg1,msg2,msg3,msg4,msg5)
{
	if(!CheckValidEmail(jQuery('#newsletter_email').val()))
	{
		jQuery('#newsletter_info').html(msg1);
		jQuery('#newsletter_email').focus();
	}
	else
	{
		jQuery('#newsletter_info').html(msg2);
		jQuery.get("/ajax/ajax_newsletter.php?lang="+lang, { e: jQuery('#newsletter_email').val(), a: newsletter_action },

		function(data)
		{
			if(data == "true") jQuery('#newsletter_info').html(msg3);
			else if(data == "exists" || data == "notexists") jQuery('#newsletter_info').html(msg5);
			else jQuery('#newsletter_info').html(msg4);
  		}

		);
	}
}

var prodIndex = 1;
function startClientsAnimation(cycle,lang, index)
{
	if(cycle == 0)
	{	
		jQuery.get('/ajax/getClientsLogo.php',{id: 1, lang: lang}, function(data)
		{
			
			jQuery('#contentClientsC').html(data);
			jQuery('.logo_animacji').length;
			jQuery('.logo_animacji').hide();
			jQuery('#logo1').show();
			
			setTimeout("startClientsAnimation(1,\""+lang+"\", 1);",5000);
			
		//	jQuery('.logo_animacji').length;
		//	jQuery('#contentClientsC').fadeTo(300,1);
		});
	}
	else
	{
		var ilosc = jQuery('.logo_animacji').length;
		jQuery('#logo'+index).fadeTo(300,0, function () {
												
												jQuery('.logo_animacji').hide();
												jQuery('.logo_animacji').css("opacity", "0");
												
												index++;
												if(index <= ilosc)
												{
													
													jQuery('#logo'+index).show();
													jQuery('#logo'+index).fadeTo(300,1,  function () {
															   setTimeout("startClientsAnimation(1,\""+lang+"\", "+index+");",5000);
																								   });
													
												}
												else
												{
													jQuery('#logo1').show();
													jQuery('#logo1').fadeTo(300,1,  function () {
															   setTimeout("startClientsAnimation(1,\""+lang+"\", 1);",5000);
																								   });
												}
													
											});
		
	//	if(index < ilosc)
	//	{
	//		index++;
	//		jQuery('#logo'+index).show();
	//		setTimeout("startClientsAnimation(1,\""+lang+"\", "+index+");",5000);
	//	}
	}
//	if(prodIndex<=0){prodIndex=1};
//	jQuery('#contentClientsC').fadeTo(300,0.02);
	
//	if(cycle==1){setTimeout("startClientsAnimation(1,\""+lang+"\");",5000);}
}

//var prodIndex = 1;
//function startClientsAnimation(cycle,lang)
//{
//	if(prodIndex<=0){prodIndex=1};
//	jQuery('#contentClientsC').fadeTo(300,0.02);
//	jQuery.get('/ajax/getClientsLogo.php',{id: prodIndex, lang: lang}, function(data){jQuery('#contentClientsC').html(data);jQuery('#contentClientsC').fadeTo(300,1);prodIndex++});
//	if(cycle==1){setTimeout("startClientsAnimation(1,\""+lang+"\");",5000);}
//}



// -->
