function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no' );
}
	
function flip(rid)
  {
    document.getElementById(rid).style.display = 'none';

  }	
function activate(rid)
  {

    if (document.getElementById("layer_1").style.display == 'none' && document.getElementById("layer_2").style.display == 'none' && document.getElementById("layer_3").style.display == 'none' && document.getElementById("layer_4").style.display == 'none')
    {
    document.getElementById(rid).style.display = 'block';
    }else if(document.getElementById(rid).style.display == 'block'){
    document.getElementById(rid).style.display = 'none';
    }else{
    document.getElementById("layer_1").style.display = 'none';
    document.getElementById("layer_2").style.display = 'none';
    document.getElementById("layer_3").style.display = 'none';
    document.getElementById("layer_4").style.display = 'none';
    document.getElementById(rid).style.display = 'block';
    }

  }




function howlong(element){
if(element.value.length>200){
alert("Przekroczono dopuszczalną ilość znaków!");
//wycinamy nadmiarowe znaki:
element.value = element.value.substr(0, 200)
}
}

function formik_a()
{
if (document.koment.tresc1.value=='') {
alert('Proszę uzupełnić pole: Treść komentarza');
return false;
}else{
if (document.koment.tresc1.value.length<3){
alert("Minimalna długość komentarza to 3 znaki!");
return false;
}
}
return true;
}

function formik_b()
{
if (document.koment.tresc2.value=='') {
alert('Proszę uzupełnić pole: Treść powiadomienia');
return false;
}else{
if (document.koment.tresc1.value.length<3){
alert("Minimalna długość powiadomienia to 3 znaki!");
return false;
}
}
if (document.polec.mail.value=='') {
alert('Proszę uzupełnić pole: E-mail znajomego');
return false;
}
return true;
}

function formik_c()
{
if (document.blad.tresc3.value=='') {
alert('Proszę uzupełnić pole: Treść zgłoszenia');
return false;
}else{
if (document.blad.tresc3.value.length<10){
alert("Minimalna długość zgłoszenia to 10 znaków!");
return false;
}
}
return true;
}

function formik_d()
{
if (document.tekst.artysci.value=='' && document.tekst.wykonawca.value=='') {
alert('Proszę wybrać lub dodać nowego wykonawcę piosenki!');
return false;
}
if (document.tekst.kata.value=='') {
alert('Proszę wybrać gatunek piosenki!');
return false;
}
if (document.tekst.tytul.value=='') {
alert('Proszę podać tytuł piosenki!');
return false;
}
if (document.tekst.tresc.value=='') {
alert('Proszę podać tekst piosenki!');
return false;
}
return true;
}

function formik_e()
{
if (document.youtube.tresc4.value=='') {
alert('Proszę uzupełnić pole: Kod klipu YouTube');
return false;
}
return true;
}

function formik_f()
{
if (document.logo.login.value=='') {
alert('Proszę uzupełnić pole: Login');
return false;
}
if (document.logo.pass.value=='') {
alert('Proszę uzupełnić pole: Hasło');
return false;
}
return true;
}
function formik_g()
{
if (document.reje.reje_login.value=='') {
alert('Proszę uzupełnić pole: Login');
return false;
}
if (document.reje.reje_pass.value=='') {
alert('Proszę uzupełnić pole: Hasło');
return false;
}
if (document.reje.reje_repass.value=='') {
alert('Proszę uzupełnić pole: Powtórz hasło');
return false;
}
if (document.reje.reje_pass.value!=document.reje.reje_repass.value) {
alert('Hasła w polu "Hasło" oraz "Powtórz hasło" nie są takie same');
return false;
}
if (document.reje.email.value=='') {
alert('Proszę uzupełnić pole: E-mail');
return false;
}
return true;
}

function formik_h()
{
if (document.haslo.login.value=='') {
alert('Proszę uzupełnić pole: Login');
return false;
}
if (document.haslo.email.value=='') {
alert('Proszę uzupełnić pole: E-mail');
return false;
}
return true;
}


function formik_i()
{
if (document.szukanie.szukaj.value=='') {
alert('Proszę najpierw podać szukaną frazę');
return false;
}
if (document.szukanie.szukaj.value.length<3){
alert("Minimalna długość szukanej frazy to 3 znaki!");
return false;
}
if (document.szukanie.gdzie.value=='') {
alert('Proszę wybrać kategorię szukania');
return false;
}
return true;
}

function formik_j()
{
if (document.reje.edit_pass.value!=document.reje.edit_repass.value) {
alert('Hasła w polu "Hasło" oraz "Powtórz hasło" nie są takie same');
return false;
}
if (document.reje.email.value=='') {
alert('Proszę uzupełnić pole: E-mail');
return false;
}

return true;
}
function formik_k()
{
if (document.pszukanie.pszukaj_a.value=='') {
alert('Proszę podać autora poszukiwanego tekstu');
return false;
}
if (document.pszukanie.pszukaj_b.value=='') {
alert('Proszę podać tytuł poszukiwanego tekstu');
return false;
}
if (document.pszukanie.pszukaj_c.value=='') {
alert('Proszę podać E-mail');
return false;
}

return true;
}

function formik_l()
{
if (document.galeria.nazwa.value=='') {
alert('Proszę podać nazwę galerii');
return false;
}
if (document.galeria.opis.value=='') {
alert('Proszę podać opis galerii');
return false;
}
if (document.galeria.nazwa.value.length<3){
alert("Minimalna długość nazwy to 3 znaki!");
return false;
}
if (document.galeria.opis.value.length<3){
alert("Minimalna długość opisu to 3 znaki!");
return false;
}
return true;
}

function formik_m()
{
if (document.galeria.file1.value=='') {
alert('Proszę wybrac zdjęcie');
return false;
}
if(! document.galeria.file1.value.match(/.*\.(jpg)$/i)) {
alert('Można wgrywać tylko zdjęcia JPG !!!');
return false;
}
if (document.galeria.gal.value=='') {
alert('Proszę wybrac galerię');
return false;
}
if (document.galeria.opis.value=='') {
alert('Proszę podać opis zdjęcia');
return false;
}
if (document.galeria.opis.value.length<3){
alert("Minimalna długość opisu to 3 znaki!");
return false;
}
return true;
}

function MakeFlash(plik ,width ,height ,bgcolor ,wersja ,align ,FlashVars){

//if (FlashVars!=''){
//	FlashVars='window_id='+ran_number+'&'+FlashVars;
//}else{
//	FlashVars='window_id='+ran_number;
//}

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+wersja+',0,0,0" width="'+width+'" height="'+height+'" id="'+plik+'" align="'+align+'">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="images/'+plik+'" />');
	document.write('<param name="id" value="'+plik+'" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="FlashVars" value="'+FlashVars+'"/>');
	document.write('<param name="quality" value="high" />');
		if (bgcolor!=''){
		    document.write('<param name="bgcolor" value="'+bgcolor+'" />');
		}else{
		    document.write('<param name="wmode" value="transparent" />');
		}
			document.write('<embed src="images/'+plik+'" quality="high" ');

		if (bgcolor!=''){
			document.write('bgcolor="'+bgcolor+'"');
		}else{
			document.write('wmode="transparent"');
		}
	document.write(' width="'+width+'" height="'+height+'" FlashVars="'+FlashVars+'" name="'+plik+'" align="'+align+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');

}

/***************************************************************************
 phpTrafficA @soft.ZoneO.net
 Copyright (C) 2004-2007 ZoneO-soft, Butchu (email: "butchu" with the domain "zoneo.net")

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 More Info About The Licence At http://www.gnu.org/copyleft/gpl.html
****************************************************************************/

function encode64(inp){
var key="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var chr1,chr2,chr3,enc3,enc4,i=0,out="";
while(i<inp.length){
chr1=inp.charCodeAt(i++);if(chr1>127) chr1=88;
chr2=inp.charCodeAt(i++);if(chr2>127) chr2=88;
chr3=inp.charCodeAt(i++);if(chr3>127) chr3=88;
if(isNaN(chr3)) {enc4=64;chr3=0;} else enc4=chr3&63
if(isNaN(chr2)) {enc3=64;chr2=0;} else enc3=((chr2<<2)|(chr3>>6))&63
out+=key.charAt((chr1>>2)&63)+key.charAt(((chr1<<4)|(chr2>>4))&63)+key.charAt(enc3)+key.charAt(enc4);
}
return encodeURIComponent(out);
}

function stats(sid){
var referer=encode64(document.referrer);
var thispage=encode64(window.location.pathname+location.search);
var date=new Date()
var time=date.getTime();
document.writeln("<img src=\"http://stats.webzi.pl/count.php?sid="+sid+"&p="+thispage+"&r="+referer+"&t="+time+"\" alt=\"\" border=\"0\" />\n");
}


function checkAll() {
for (var j = 1; j <= 14; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == false) box.checked = true;
   }
}

function uncheckAll() {
for (var j = 1; j <= 14; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == true) box.checked = false;
   }
}

function switchAll() {
for (var j = 1; j <= 14; j++) {
box = eval("document.checkboxform.C" + j);
box.checked = !box.checked;
   }
}
function checkForm(t) {
  var p = t['plik'];
  if(! p.value.match(/.*\.(jpg|zip)$/i)) {
    alert('Dupa !!!');
    p.value = '';
    return false;
  }
  return true;
}


