// Funkcja sluzaca do rozwijania zawartosci
function zwinRozwin(id)
{
	jQuery("div .contentDzialalnoscOpakowanie:not(#"+id+")").animate({opacity: 'hide', height: 'hide'}, 500 );
	
	if(jQuery("#"+id).css("display")=='block') jQuery("#"+id).animate({opacity: 'hide', height: 'hide'}, 500 );
	else jQuery("#"+id).animate({opacity: 'show', height: 'show'}, 500 );
	
	setTimeout(function(){
		jQuery("#panel").jScrollPane({showArrows:true,reinitialiseOnImageLoad: true});
	},500);
}

// Funkcja sluzaca do rozwijania zawartosci
function zwinRozwinOper(id)
{
	jQuery("div .contentDzialalnoscOpakowanie:not(#"+id+")").animate({opacity: 'hide', height: 'hide'}, 500 );
	jQuery("div .contentDzialalnoscHead:not(#"+id+"h)").animate({opacity: 'hide', height: 'hide', paddingBottom: 'hide'}, 500 );
	
	if(jQuery("#"+id).css("display")=='block') {
		jQuery("div .contentDzialalnoscHead").animate({opacity: 'show', height: 'show', paddingBottom: 'show'}, 500 );
		jQuery("#"+id).animate({opacity: 'hide', height: 'hide'}, 500 );
		jQuery("#zakres").css("display","none");
	} else {
		jQuery("#"+id).animate({opacity: 'show', height: 'show'}, 500 );
		jQuery("#zakres").css("display","block");
	}
	
	setTimeout(function(){jQuery("#panel").jScrollPane({showArrows:true,reinitialiseOnImageLoad: true});},500);
	setTimeout(function(){jQuery('#panel')[0].scrollTo(parseInt('0')); },500);
}

function zwinRozwinAll() {
	jQuery("div .contentDzialalnoscHead").animate({opacity: 'show', height: 'show', paddingBottom: 'show'}, 500 );
	jQuery("div .contentDzialalnoscOpakowanie").animate({opacity: 'hide', height: 'hide'}, 500 );
	jQuery("#zakres").css("display","none");
	
	setTimeout(function(){jQuery("#panel").jScrollPane({showArrows:true,reinitialiseOnImageLoad: true});},500);
	setTimeout(function(){jQuery('#panel')[0].scrollTo(parseInt('0')); },500);
}

function gotoZakresDzialalnosci(id) {
	zwinRozwinAll();
	
	setTimeout(function(){zwinRozwinOper(id)},700);
}

function zwinRozwinPerson(id)
{
	jQuery("div .contentzespolOpakowanieDescription:not(#"+id+")").animate({opacity: 'hide', height: 'hide'}, 500 );
	jQuery("div .wiecej:not(#w"+id+")").css('display','block');
	jQuery("div .zwin:not(#z"+id+")").css('display','none');
	
	if(jQuery("#"+id).css("display")=='block') {
		jQuery("#"+id).animate({opacity: 'hide', height: 'hide'}, 500 );
		jQuery("#w"+id).css('display','block');
		jQuery("#z"+id).css('display','none');
	}
	else {
		jQuery("#"+id).animate({opacity: 'show', height: 'show'}, 500 );
		jQuery("#z"+id).css('display','block');
		jQuery("#w"+id).css('display','none');
	}
	
	setTimeout(function(){
		jQuery("#panel").jScrollPane({showArrows:true,reinitialiseOnImageLoad: true});
	},500);
}

function clearFile(value,name) {
	jQuery("input[name="+name+"]").val();
	if(jQuery("input[name="+name+"]").val()==value) jQuery("input[name="+name+"]").val("");
}

function changeHref(showDiv,showLink,hideDiv,hideLink) {
	jQuery("#"+showDiv).css('display','block');
	jQuery("#"+hideDiv).css('display','none');
	
	jQuery("#"+showLink).removeClass("href1").addClass("href4");
	jQuery("#"+hideLink).removeClass("href4").addClass("href1");
	
	setTimeout(function(){
		jQuery("#panel").jScrollPane({showArrows:true,reinitialiseOnImageLoad: true});
	},500);
}

function preloadImage(obrazki)
{
	var tabelaObrazki=obrazki.split(",");
	
	for (i=0; i<tabelaObrazki.length; i++){
		picture= new Image;
		picture.src = "/files/framework/"+tabelaObrazki[i];
	}
}

function change2Mail() {
	var mailto = jQuery("a[href^=mailto]");
	
	mailto.each(function () {
		jQuery(this).attr("href",jQuery(this).attr("href").replace('____','@'));
		jQuery(this).html(jQuery(this).html().replace('____','@'));
	});
}

function changeMenuOnMouseOver(changeFrom,changeOnto) {
	//0-home, 1-o kancelarii, 2-zakres dzialania, 3-newsletter, 3-sdz w mediach, 3-przydatne linki, 4-kontakt, 5-zespol
	//jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxMenu3");
	
	if(changeFrom=='0') {
		if(changeOnto=='0') {}
		else if(changeOnto=='1') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu4");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg2");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
		}
		else if(changeOnto=='2') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu4");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxImg6");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox5");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
		}
		else if(changeOnto=='3') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu4");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox1");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg2");
		}
		else if(changeOnto=='4') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu4");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg1");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBox3");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg7");
		}
		else if(changeOnto=='5') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox2");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu4");
		}
	}
	else if(changeFrom=='1') {
		if(changeOnto=='0') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu4");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href2");
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
			jQuery("#m2 a").removeClass(jQuery("#m2 a").attr("class")).addClass("href2");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxImg4");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
		}
		else if(changeOnto=='1') {}
		else if(changeOnto=='2') {
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu4");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxImg6");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox5");
		}
		else if(changeOnto=='3') {
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox1");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg2");
		}
		else if(changeOnto=='4') {
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg1");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBox3");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg7");
		}
		else if(changeOnto=='5') {
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox2");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
		}
	}
	else if(changeFrom=='2') {
		if(changeOnto=='0') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu4");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href2");
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxImg4");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
		}
		else if(changeOnto=='1') {
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu4");
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg2");
		}
		else if(changeOnto=='2') {}
		else if(changeOnto=='3') {
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu4");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox1");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg2");
		}
		else if(changeOnto=='4') {
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu4");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg1");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBox3");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg7");
		}
		else if(changeOnto=='5') {
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu4");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox2");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
		}
	}
	else if(changeFrom=='3') {
		if(changeOnto=='0') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu4");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href2");
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxImg4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
		}
		else if(changeOnto=='1') {
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu4");
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg2");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
		}
		else if(changeOnto=='2') {
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu4");
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxImg6");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox5");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
		}
		else if(changeOnto=='3') {}
		else if(changeOnto=='4') {
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu4");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg1");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBox3");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg7");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
		}
		else if(changeOnto=='5') {
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox2");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
		}
	}
	else if(changeFrom=='4') {
		if(changeOnto=='0') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu4");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href2");
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxImg4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
		}
		else if(changeOnto=='1') {
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu4");
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg2");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
		}
		else if(changeOnto=='2') {
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu4");
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxImg6");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox5");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
		}
		else if(changeOnto=='3') {
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu4");
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox1");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg2");
		}
		else if(changeOnto=='4') {}
		else if(changeOnto=='5') {
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox2");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
		}
	}
	else if(changeFrom=='5') {
		if(changeOnto=='0') {
			jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu4");
			jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href2");
			jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxImg4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
		}
		else if(changeOnto=='1') {
			jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg2");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
		}
		else if(changeOnto=='2') {
			jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu4");
			jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxImg6");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox5");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
		}
		else if(changeOnto=='3') {
			jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu4");
			jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox1");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg2");
		}
		else if(changeOnto=='4') {
			jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu4");
			jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg1");
			jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBox3");
			jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
			jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg7");
		}
		else if(changeOnto=='5') {}
	}
}

function changeMenuOnMouseOut(changeFrom,changeOnto) {
	//0-home, 1-o kancelarii, 2-zakres dzialania, 3-newsletter, 3-sdz w mediach, 3-przydatne linki, 4-kontakt, 5-zespol
	//jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxMenu3");
	
	if(changeFrom=='0') {
		jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu4");
		jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href2");
		jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
		jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
		jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
		jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
		jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxImg4");
		jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
		jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
		jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
		jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
		jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
		jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
	}
	else if(changeFrom=='1') {
		jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
		jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
		jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu4");
		jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
		jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
		jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
		jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
		jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
		jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox7");
		jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg2");
		jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
		jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
		jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
	}
	else if(changeFrom=='2') {
		jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
		jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
		jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
		jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu4");
		jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
		jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
		jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxImg6");
		jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
		jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox5");
		jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
		jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
		jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
		jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxEmpty");
	}
	else if(changeFrom=='3') {
		jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
		jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
		jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
		jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
		jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu4");
		jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
		jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
		jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBox1");
		jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxEmpty");
		jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
		jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
		jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg2");
		jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
	}
	else if(changeFrom=='4') {
		jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
		jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
		jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
		jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
		jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
		jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu4");
		jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
		jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
		jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
		jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBoxImg1");
		jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBox3");
		jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu2");
		jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg7");
	}
	else if(changeFrom=='5') {
		jQuery("#m1").removeClass(jQuery("#m1").attr("class")).addClass("topBoxMenu1");
		jQuery("#m1 a").removeClass(jQuery("#m1 a").attr("class")).addClass("href1");
		jQuery("#m2").removeClass(jQuery("#m2").attr("class")).addClass("topBoxMenu2");
		jQuery("#m3").removeClass(jQuery("#m3").attr("class")).addClass("topBoxMenu2");
		jQuery("#m4").removeClass(jQuery("#m4").attr("class")).addClass("topBoxMenu2");
		jQuery("#m5").removeClass(jQuery("#m5").attr("class")).addClass("topBoxMenu3");
		jQuery("#m6").removeClass(jQuery("#m6").attr("class")).addClass("topBoxEmpty");
		jQuery("#t1").removeClass(jQuery("#t1").attr("class")).addClass("topBoxEmpty");
		jQuery("#t2").removeClass(jQuery("#t2").attr("class")).addClass("topBoxEmpty");
		jQuery("#t3").removeClass(jQuery("#t3").attr("class")).addClass("topBox2");
		jQuery("#t4").removeClass(jQuery("#t4").attr("class")).addClass("topBoxEmpty");
		jQuery("#b3").removeClass(jQuery("#b3").attr("class")).addClass("topBoxMenu4");
		jQuery("#b4").removeClass(jQuery("#b4").attr("class")).addClass("topBoxImg5");
	}
}

function startAnimationDefault(typ) {
	
	//Ustawienia
	var timeStamp1=200;
	var timeStamp2=400;
	var time=0;
	
	jQuery("#animationHome1").fadeIn(timeStamp1);
	setTimeout(function(){jQuery("#animationKancelaria1").css('display','block').animate({'left': '162px'},timeStamp1);},(time+=timeStamp1));
	setTimeout(function(){jQuery("#animationBox1").fadeIn(timeStamp2);}, (time+=timeStamp2));
	setTimeout(function(){jQuery("#animationBox2").fadeIn(timeStamp2);}, (time+=timeStamp2));
	setTimeout(function(){jQuery("#animationBox1").fadeOut(timeStamp2);}, (time+=timeStamp2));
	setTimeout(function(){jQuery("#animationZakres1").css('display','block').animate({'left': '306px'},timeStamp1);},(time+=timeStamp1));
	setTimeout(function(){
		jQuery("#animationBox3, #animationBox4").css('display','block');
		jQuery("#animationBox2, #animationKancelaria1").fadeOut(timeStamp2);
	},(time+=timeStamp2));
	setTimeout(function(){jQuery("#animationBox5").fadeIn(timeStamp2);}, (time+=timeStamp2));
	setTimeout(function(){jQuery("#animationBox5").fadeOut(timeStamp2);}, (time+=timeStamp2));
	setTimeout(function(){jQuery("#animationZespol1").css('display','block').animate({'top': '290px'},timeStamp1);},(time+=timeStamp1));
	setTimeout(function(){
		jQuery("#animationBox6").css('display','block');
		jQuery("#animationZakres1, #animationBox3").fadeOut(timeStamp2);
	}, (time+=timeStamp2));
	setTimeout(function(){
		jQuery("#animationBox7, #animationBox8").fadeIn(timeStamp2);
	}, (time+=timeStamp2));
	setTimeout(function(){jQuery("#animationNewsletter1").css('display','block').animate({'left': '450px'},timeStamp1);},(time+=timeStamp1));
	setTimeout(function(){
		jQuery("#animationBox9").css('display','block');
		jQuery("#animationZespol1, #animationBox7, #animationBox8").fadeOut(timeStamp2);
	}, (time+=timeStamp2));
	setTimeout(function(){jQuery("#animationBox10, #animationBox11").fadeIn(timeStamp2);}, (time+=timeStamp2));
	setTimeout(function(){jQuery("#animationBox10, #animationBox11").fadeOut(timeStamp2);}, (time+=timeStamp2));
	setTimeout(function(){jQuery("#animationKontakt1").css('display','block').animate({'left': '594px'},timeStamp1);},(time+=timeStamp1));
	setTimeout(function(){
		jQuery("#animationNewsletter1").fadeOut(timeStamp2);
		jQuery("#animationBox12").css('display','block');
	}, (time+=timeStamp2));
	switch(typ) {
		case '0':
			setTimeout(function(){jQuery("#animationBox13, #animationBox14, #animationBox15").fadeIn(timeStamp2);}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationKontakt1").fadeOut(timeStamp2);
				jQuery("#animationKontakt2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox12").fadeOut(timeStamp2);
				jQuery("#animationNewsletter2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox6").fadeOut(timeStamp2);
				jQuery("#animationZakres2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox9").fadeOut(timeStamp2);
				jQuery("#animationZespol2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox4").fadeOut(timeStamp2);
				jQuery("#animationKancelaria2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationHome1").fadeOut(timeStamp2);
				jQuery("#animationHome2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){jQuery("#animation").remove();}, (time+=timeStamp2));
			break;
		case '1':
			setTimeout(function(){jQuery("#animationBox16, #animationBox17").fadeIn(timeStamp2);}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationKontakt1").fadeOut(timeStamp2);
				jQuery("#animationKontakt2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox12").fadeOut(timeStamp2);
				jQuery("#animationNewsletter2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox6").fadeOut(timeStamp2);
				jQuery("#animationZakres2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox9").fadeOut(timeStamp2);
				jQuery("#animationZespol2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox4").fadeOut(timeStamp2);
				jQuery("#animationKancelaria3").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){jQuery("#animation").remove();}, (time+=timeStamp2));
			break;
		case '2':
			setTimeout(function(){jQuery("#animationBox18, #animationBox19").fadeIn(timeStamp2);}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationKontakt1").fadeOut(timeStamp2);
				jQuery("#animationKontakt2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox12").fadeOut(timeStamp2);
				jQuery("#animationNewsletter2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox6").fadeOut(timeStamp2);
				jQuery("#animationZakres3").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox9").fadeOut(timeStamp2);
				jQuery("#animationZespol2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox4").fadeOut(timeStamp2);
				jQuery("#animationKancelaria2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){jQuery("#animation").remove();}, (time+=timeStamp2));
			break;
		case '3':
			setTimeout(function(){jQuery("#animationBox20, #animationBox21").fadeIn(timeStamp2);}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationKontakt1").fadeOut(timeStamp2);
				jQuery("#animationKontakt2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox12").fadeOut(timeStamp2);
				jQuery("#animationNewsletter3").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox6").fadeOut(timeStamp2);
				jQuery("#animationZakres2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox9").fadeOut(timeStamp2);
				jQuery("#animationZespol2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox4").fadeOut(timeStamp2);
				jQuery("#animationKancelaria2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){jQuery("#animation").remove();}, (time+=timeStamp2));
			break;
		case '4':
			setTimeout(function(){jQuery("#animationBox22, #animationBox23, #animationBox24").fadeIn(timeStamp2);}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox12").fadeOut(timeStamp2);
				jQuery("#animationNewsletter2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox6").fadeOut(timeStamp2);
				jQuery("#animationZakres2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox9").fadeOut(timeStamp2);
				jQuery("#animationZespol2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox4").fadeOut(timeStamp2);
				jQuery("#animationKancelaria2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){jQuery("#animation").remove();}, (time+=timeStamp2));
			break;
		case '5':
			setTimeout(function(){jQuery("#animationBox25, #animationBox26").fadeIn(timeStamp2);}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationKontakt1").fadeOut(timeStamp2);
				jQuery("#animationKontakt2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox12").fadeOut(timeStamp2);
				jQuery("#animationNewsletter2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox6").fadeOut(timeStamp2);
				jQuery("#animationZakres2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox9").fadeOut(timeStamp2);
				jQuery("#animationZespol3").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){
				jQuery("#animationBox4").fadeOut(timeStamp2);
				jQuery("#animationKancelaria2").css('display','block');
			}, (time+=timeStamp2));
			setTimeout(function(){jQuery("#animation").css({"display":"none"}).remove();}, (time+=timeStamp2));
			break;
	}
}

function showImageNews(type) {
	var div = jQuery("#animation").css("display");
	jQuery("#b4 img").stop();
	
	if(type=='1' && div!="block") {
		jQuery("#b4 img").fadeTo(200, 1.0);
	} else if(type=="2" && div!="block") {
		jQuery("#b4 img").fadeTo(200, 0.0);
	} else {
		jQuery("#b4 img").fadeTo(1, 0.0).css({'display':'block'});
	}
	
}

function showImageContact(type) {
	var div = jQuery("#animation").css("display");
	jQuery("#b4 img").stop();
	
	if(type=='1' && div!="block") {
		jQuery("#b4").removeClass("topBoxMenu3").addClass("topBoxMenu5");
		jQuery("#b4 img").fadeTo(200, 1.0);
	} else if(type=="2" && div!="block") {
		jQuery("#b4 img").fadeTo(200, 0.0);
		setTimeout(function(){jQuery("#b4").removeClass("topBoxMenu5").addClass("topBoxMenu3");},200);
	} else {
		jQuery("#b4 img").fadeTo(1, 0.0).css({'display':'block'});
	}
	
}

function openPreview(){
	var tresc = "<body TOPMARGIN=\"0\" LEFTMARGIN=\"0\" MARGINHEIGHT=\"0\" MARGINWIDTH=\"0\">"+jQuery(".contentAdminPrev").html().replace("__TRESC__", jQuery(".adminInputText").val().replace(/\n/g, "<br />"))+"</body>";
	okno = window.open("about:blank", "preview", "width=1100,height=500,resizable=yes,scrollbars=yes");
	okno.document.write(tresc);
}

function chengeNews(id) {
	jQuery("div[id^=_newsTresc_], div[id^=_newsData_], div[id^=_newsMenu_]").css("display","none");
	jQuery("div[id=_newsTresc_"+id+"], div[id=_newsData_"+id+"], div[id=_newsMenu_"+id+"]").css("display","block");
}

// Funkcja sluzaca do rozwijania zawartosci
function zwinRozwinOnLoad(id)
{
	setTimeout(function(){zwinRozwinOper('_'+id);},1000);
}


