<!-- 


function toggle(item2, stan) {
	var item = document.getElementById(item2);
	if (stan==1) item.style.display = '';
	else if (stan==2) item.style.display = 'none';
	else {
		if (item.style.display == '') {
			item.style.display = 'none';
		} else {
			item.style.display = '';
		}
	}
}
var nastepne=0;
function przelacz_foto(jakie) {
	if (nastepne==0) nastepne=jakie;
	nastepne++;
	toggle('foto'+nastepne,true);
	if (nastepne==10) toggle('dodaj_kolejne',false);
}
function pokaz_dzial_stopka(id,all) {
	for (var i=1;i<=all;i++) {
		if (i==id) toggle('stopka_menu_'+i,1);
		else {
			if (document.getElementById('stopka_menu_'+i)) {
				toggle('stopka_menu_'+i,2);
			}
		}
	}
}
aktualny_dzial = 0;
function pokaz_dzial(id) {
	if (aktualny_dzial != 0) {
		if (aktualny_dzial != id) {
			var item = document.getElementById('d_'+aktualny_dzial);
			item.className = 'menu_off';
			toggle('id_'+aktualny_dzial,2);
			toggle('id_'+id);
		} else {
			toggle('id_'+id);
		}
	} else {
		toggle('id_'+id,1);
	}
	
	aktualny_dzial = id;
}

function zmiana_dzialu(id, stan) {
	if (stan==true) {
		var item = document.getElementById('d_'+id);
		item.className='menu_on';
	} else {
		if (id!=aktualny_dzial) {
			var item = document.getElementById('d_'+id);
			item.className='menu_off';
		}
	}
}

function popup(mylink, windowname)
{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string') {
		href=mylink;
	} else {
		href=mylink.href;
	}
	window.open(href, windowname, 'width=520,height=540,scrollbars=yes');
	return false;
}

function popImage(url,windowTitle,windowName,closeOnClick,width,height,t){
	closeOnClick=true;
	if(!url)return
	function readSize(){if(t.complete)showPopup(t.width,t.height);else setTimeout(readSize,1e2)}
	function showPopup(w,h){with(window.open('',windowName||'','width='+(width||w)+',height='+(height||h)).document){open();write('<html><head><title>'+(windowTitle||'')+'</title></head><body onBlur="self.close()" style="margin:0;padding:0"><img src="'+url+'" style="display:block'+(closeOnClick?';cursor: pointer" onclick="self.close()" title="Zamknij okno"':'"')+'></body></html>');close()}}
	if(!width||!height)t=new Image(),t.src=url,readSize()
	else showPopup(width,height)
}

Array.prototype.inArray = function(v){
	for (var i in this) {
		if (this[i] == v) {
			return true;
		}
	}
	return false;
}

aOpenNormalne = new Array();

function pokaz_dane_normalny(id) {
	var divDaneNormalny = document.getElementById('dane_normalny_' + id);	
//	alert(divDaneNormalny.style.display );
	if (divDaneNormalny.style.display == 'none') {
		if (aOpenNormalne.inArray(id)) {
			divDaneNormalny.style.display = 'block';
		} else {
			var imgSmallLoadingGif = document.getElementById('smallLoadingGif_' + id);	
			imgSmallLoadingGif.style.display = 'block';
			advAJAX.setDefaultParameters({
				onSuccess: function(obj){
					document.getElementById(obj.tag).innerHTML = obj.responseText;
					document.getElementById(obj.tag).style.display = 'block';
					aOpenNormalne.push(id);
					imgSmallLoadingGif.style.display = 'none';
				},
				onError: function(obj){
					document.getElementById(obj.tag).innerHTML = "Błąd...";
				}
			});
			advAJAX.get({
				url: "ajax_dane.php?id=" + id,
				tag: "dane_normalny_" + id
			});
			advAJAX.setDefaultParameters({});
		}
	} else {
		divDaneNormalny.style.display = 'none';
	}
	
}

//show MORE ARTICLES OR RIGHT
function showMoreArticlesOnright(iId)
{
	divMoreArticles = jQuery('#articleOnRightMore' + iId);	
	divMoreArticles.toggle(200);
	
	divMoreArticlesMore = jQuery('#articleOnRightMoreHrefMore' + iId);	
	divMoreArticlesMore.toggle(200);
	
	divMoreArticlesLess = jQuery('#articleOnRightMoreHrefLess' + iId);	
	divMoreArticlesLess.toggle(200);
}
 
function show(sTarget) 
{
	jQuery("#" + sTarget).show();
	return false;
}

function showLoadingComCli(sTarget)
{
	jQuery("#" + sTarget + "SmallLoadingGif").show();
	jQuery("#submit" + sTarget).hide();
}

function enableClientNewsletterPreview()
{
	jQuery("#firmClientsNewsletterPreview").attr("disabled", false); // enable
}

function enableClientNewsletter()
{
	jQuery("#firmClientsNewsletter").attr("disabled", false); // enable
}

function initializeFirmClientNewsletter()
{

	tinyMCE.init({
		// General options
		mode : "exact",
   		elements : "firmClientsNewsletterTextarea",
     relative_urls: false,
     remove_script_host: false,
     convert_urls: true,
     verify_html : true,
     inline_styles : true,
     convert_fonts_to_spans : true,
     force_p_newlines : false,
     force_hex_style_colors : true,
     plugins : "advimage,paste,advlink,inlinepopups",
//		plugins : 		"pagebreak,nonbreaking",
	
		// Theme options
//		theme_advanced_buttons1 : "bold,italic,underline,justifycenter,strikethrough,|,cut,copy,|,undo,redo,|,link,unlink,code,",
		theme_advanced_buttons1 : "bold,italic,underline,justifycenter,strikethrough,|,cut,copy,|,undo,redo,",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : false
	  });	
}


var aDivs = new Array('comments','clients','offers','entries');

function toggleDivs(sTarget,sClassName)
{
	iDivs = aDivs.length;
	for (i=0; i < iDivs; i++) {
		hDir = jQuery("#" + aDivs[i]);
		if (hDir != undefined) {
			hDir.hide();
			focusActiveDiv('#toggle' + aDivs[i],true,sClassName);
		}
	}
	jQuery("#" + sTarget).show();	
	focusActiveDiv('#toggle' + sTarget,false,sClassName);
}

function focusActiveDiv(handleDiv,bOff,sClassName) 
{
	if (!bOff) {
		jQuery(handleDiv).addClass(sClassName + 'Active');
	} else {
		jQuery(handleDiv).removeClass(sClassName + 'Active');
	}
}


-->
