T$('startowa').onclick = function(){TINY.box.show('startowa.php',1,450,350,1)}

$(document).ready(function() { 
    $('#myForm').ajaxForm({
        beforeSubmit: function(a,f,o) {
			$('#main-right').html('<br><center><img src="images/loading.gif" /></center><br>').fadeIn('slow');
        },
        success: function(data) {
            var $out = $('#main-right');
            $out.html('');
            if (typeof data == 'object' && data.nodeType)
                data = elementToString(data.documentElement, true);
            else if (typeof data == 'object')
                data = objToString(data);
            $out.append(''+ data +'');
        }
    });
	    });

function sort(id)
		{
			document.getElementById('sort').value=id;
			document.getElementById('sort_form').submit();
		}

		function order(id)
		{
			document.getElementById('order').value=id;
			document.getElementById('sort_form').submit();
		}

		function keywords_show()
		{
		b = document.getElementById("keywords_10").style.display;
		if(b == "block"){
			document.getElementById("keywords_10").style.display = "none";
			document.getElementById("keywords_100").style.display = "block";
		}
		if(b == "none"){
			document.getElementById("keywords_100").style.display = "none";
			document.getElementById("keywords_10").style.display = "block";
		}
		return false;
		}

		function school_show(id)
		{
		a = document.getElementById("sch_" + id).className;
		if(a != "active"){
			document.getElementById("sch_1").className = "";
			document.getElementById("sch_2").className = "";
			document.getElementById("sch_3").className = "";
			document.getElementById("sch_4").className = "";
			document.getElementById("szkola_1").style.display = "none";
			document.getElementById("szkola_2").style.display = "none";
			document.getElementById("szkola_3").style.display = "none";
			document.getElementById("szkola_4").style.display = "none";
			document.getElementById("sch_" + id).className = "active";
			document.getElementById("szkola_" + id).style.display = "block";
		}
		}

		function pay_show(id)
		{
		a = document.getElementById("pay_" + id).className;
		if(a != "active"){
			document.getElementById("pay_1").className = "";
			document.getElementById("pay_2").className = "";
			document.getElementById("payment_1").style.display = "none";
			document.getElementById("payment_2").style.display = "none";
			document.getElementById("pay_" + id).className = "active";
			document.getElementById("payment_" + id).style.display = "block";
		}
		}

		function material_show(id)
		{
		a = document.getElementById("mat_" + id).className;
		if(a != "active"){
			document.getElementById("mat_1").className = "";
			document.getElementById("mat_2").className = "";
			document.getElementById("mat_3").className = "";
			document.getElementById("mat_4").className = "";
			document.getElementById("material_1").style.display = "none";
			document.getElementById("material_2").style.display = "none";
			document.getElementById("material_3").style.display = "none";
			document.getElementById("material_4").style.display = "none";
			document.getElementById("mat_" + id).className = "active";
			document.getElementById("material_" + id).style.display = "block";
		}
		}

		function naj_show(id)
		{
		a = document.getElementById("best_" + id).className;
		if(a != "active"){
			document.getElementById("best_1").className = "";
			document.getElementById("best_2").className = "";
			document.getElementById("best_3").className = "";
			document.getElementById("naj_1").style.display = "none";
			document.getElementById("naj_2").style.display = "none";
			document.getElementById("naj_3").style.display = "none";
			document.getElementById("best_" + id).className = "active";
			document.getElementById("naj_" + id).style.display = "block";
		}
		}

		function pkt_show(id)
		{
		a = document.getElementById("pkt_" + id).className;
		if(a != "active"){
			document.getElementById("pkt_1").className = "";
			document.getElementById("pkt_2").className = "";
			document.getElementById("pkt_3").className = "";
			document.getElementById("pkt_4").className = "";
			document.getElementById("time_1").style.display = "none";
			document.getElementById("time_2").style.display = "none";
			document.getElementById("time_3").style.display = "none";
			document.getElementById("time_4").style.display = "none";
			document.getElementById("pkt_" + id).className = "active";
			document.getElementById("time_" + id).style.display = "block";
		}
		}

		function rate_show(id)
		{
		a = document.getElementById("points_" + id).className;
		if(a != "active"){
			document.getElementById("points_1").className = "";
			document.getElementById("points_2").className = "";
			document.getElementById("points_3").className = "";
			document.getElementById("points_4").className = "";
			document.getElementById("rate_1").style.display = "none";
			document.getElementById("rate_2").style.display = "none";
			document.getElementById("rate_3").style.display = "none";
			document.getElementById("rate_4").style.display = "none";
			document.getElementById("points_" + id).className = "active";
			document.getElementById("rate_" + id).style.display = "block";
		}
		}

		function news_show(id)
		{
		a = document.getElementById("newsa_" + id).className;
		if(a != "active"){
			document.getElementById("newsa_1").className = "";
			document.getElementById("newsa_2").className = "";
			document.getElementById("newsa_3").className = "";
			document.getElementById("newslist_1").style.display = "none";
			document.getElementById("newslist_2").style.display = "none";
			document.getElementById("newslist_3").style.display = "none";
			document.getElementById("newsa_" + id).className = "active";
			document.getElementById("newslist_" + id).style.display = "block";
		}
		}

		function news_show2(id, ile)
		{
		a = document.getElementById("newsb_" + id).className;
		if(a != "active"){
			for (i = 1; i <= ile; i++){
			document.getElementById("newsb_" + i).className = "";
			document.getElementById("newslista_" + i).style.display = "none";
			}
			document.getElementById("newsb_" + id).className = "active";
			document.getElementById("newslista_" + id).style.display = "block";
		}
		}

		function arts_show(id, ile)
		{
		a = document.getElementById("arts_" + id).className;
		if(a != "active"){
			for (i = 1; i <= ile; i++){
			document.getElementById("arts_" + i).className = "";
			document.getElementById("artlist_" + i).style.display = "none";
			}
			document.getElementById("arts_" + id).className = "active";
			document.getElementById("artlist_" + id).style.display = "block";
		}
		}

		function plagiat_show()
		{
		b = document.getElementById("plagiat").style.display;
		if(b == "block"){
			document.getElementById("plagiat").style.display = "none";
		}
		if(b == "none"){
			document.getElementById("plagiat").style.display = "block";
		}
		}

		function pro_show(id)
		{
		a = document.getElementById("pro_" + id).className;
		if(a != "active"){
			document.getElementById("pro_1").className = "";
			document.getElementById("pro_2").className = "";
			document.getElementById("pro_3").className = "";
			document.getElementById("pro_4").className = "";
			document.getElementById("pro_5").className = "";
			document.getElementById("news_01").style.display = "none";
			document.getElementById("news_02").style.display = "none";
			document.getElementById("news_03").style.display = "none";
			document.getElementById("news_04").style.display = "none";
			document.getElementById("news_05").style.display = "none";
			document.getElementById("pro_" + id).className = "active";
			document.getElementById("news_0" + id).style.display = "block";
		}
		}

		function drukuj(){
   		if (!window.print){
      		alert("Twoja przeglądarka nie drukuje!")
   		return 0;
   		}
 		window.print();
		}
		
		
/*

CUSTOM FORM ELEMENTS

Created by Ryan Fait
www.ryanfait.com

The only things you may need to change in this file are the following
variables: checkboxHeight, radioHeight and selectWidth (lines 24, 25, 26)

The numbers you set for checkboxHeight and radioHeight should be one quarter
of the total height of the image want to use for checkboxes and radio
buttons. Both images should contain the four stages of both inputs stacked
on top of each other in this order: unchecked, unchecked-clicked, checked,
checked-clicked.

You may need to adjust your images a bit if there is a slight vertical
movement during the different stages of the button activation.

The value of selectWidth should be the width of your select list image.

Visit http://ryanfait.com/ for more information.

*/

var checkboxHeight = "25";
var radioHeight = "25";
var selectWidth = "296";


/* No need to change anything after this */


document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; } .disabled { opacity: 0.5; filter: alpha(opacity=50); }</style>');

var Custom = {
	init: function() {
		var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
		for(a = 0; a < inputs.length; a++) {
			if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") {
				span[a] = document.createElement("span");
				span[a].className = inputs[a].type;

				if(inputs[a].checked == true) {
					if(inputs[a].type == "checkbox") {
						position = "0 -" + (checkboxHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					} else {
						position = "0 -" + (radioHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					}
				}
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				inputs[a].onchange = Custom.clear;
				if(!inputs[a].getAttribute("disabled")) {
					span[a].onmousedown = Custom.pushed;
					span[a].onmouseup = Custom.check;
				} else {
					span[a].className = span[a].className += " disabled";
				}
			}
		}
		inputs = document.getElementsByTagName("select");
		for(a = 0; a < inputs.length; a++) {
			if(inputs[a].className == "styled") {
				option = inputs[a].getElementsByTagName("option");
				active = option[0].childNodes[0].nodeValue;
				textnode = document.createTextNode(active);
				for(b = 0; b < option.length; b++) {
					if(option[b].selected == true) {
						textnode = document.createTextNode(option[b].childNodes[0].nodeValue);
					}
				}
				span[a] = document.createElement("span");
				span[a].className = "select";
				span[a].id = "select" + inputs[a].name;
				span[a].appendChild(textnode);
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				if(!inputs[a].getAttribute("disabled")) {
					inputs[a].onchange = Custom.choose;
				} else {
					inputs[a].previousSibling.className = inputs[a].previousSibling.className += " disabled";
				}
			}
		}
		document.onmouseup = Custom.clear;
	},
	pushed: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px";
		} else if(element.checked == true && element.type == "radio") {
			this.style.backgroundPosition = "0 -" + radioHeight*3 + "px";
		} else if(element.checked != true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight + "px";
		} else {
			this.style.backgroundPosition = "0 -" + radioHeight + "px";
		}
	},
	check: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 0";
			element.checked = false;
		} else {
			if(element.type == "checkbox") {
				this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else {
				this.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
				group = this.nextSibling.name;
				inputs = document.getElementsByTagName("input");
				for(a = 0; a < inputs.length; a++) {
					if(inputs[a].name == group && inputs[a] != this.nextSibling) {
						inputs[a].previousSibling.style.backgroundPosition = "0 0";
					}
				}
			}
			element.checked = true;
		}
	},
	clear: function() {
		inputs = document.getElementsByTagName("input");
		for(var b = 0; b < inputs.length; b++) {
			if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
			} else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
			} else if(inputs[b].type == "radio" && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
			}
		}
	},
	choose: function() {
		option = this.getElementsByTagName("option");
		for(d = 0; d < option.length; d++) {
			if(option[d].selected == true) {
				document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;
			}
		}
	}
}
window.onload = Custom.init;

