function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




function poprawne_znaki(text, wzorzec)
 { 
    var i,j; // liczniki
	var okZnak=0; // licznik poprawnych znakow w zmiennej text
	var ileZnakow=text.length; // dlugosc tekstu
		
    for(i=0; i < ileZnakow ; i++ )
       for(j=0; j < wzorzec.length ; j++ )
       	  if( text.charAt(i) == wzorzec.charAt(j) )
         	okZnak++ ;
    //jesli dla karzdego znaku znalazl poprawna maske to
    if(okZnak == ileZnakow )
       return true;
    else 
	   return false;
 }	


function o(plik,w,h)
{
if(window.screen){
 aw=screen.availWidth;
 ah=screen.availHeight;
}else{
 aw=640;
 ah=450;
}

ustawienia=
 "left=" + (aw-w)/2 + ","
 +"top=" + (ah-h)/2 + ","
 +"screenX=" + (aw-w)/2 + ","
 +"screenY=" + (ah-h)/2 + ","
 +"width=" + w + ","
 +"height=" + h + ","
 +"innerWidth=" + w + ","
 +"innerHeight=" + h + ","
 +"toolbar=no,"
 +"location=no,"
 +"directories=no,"
 +"status=no,"
 +"menubar=no,"
 +"scrollbars=yes,"
 +"resizable=no"

 noweOkienko = window.open(plik,'ksiega',ustawienia);
 noweOkienko.resizeTo(w,h);
 noweOkienko.focus();
}



function zmalqp(){
var df=document.forms['formularz'];
var c=df.elements.all.checked;
for(var i=0;i<df.elements.length;i++)

        if (df.elements[i].type=="checkbox")
                df.elements[i].checked=c;
}


function kontakt(lang)
{
Wzor_email  =/^[0-9a-zA-Z._-]+\@[0-9a-zA-Z_-]+\.[0-9a-zA-Z._]+$/;

if (lang=='pl')
{
var blad_imie	    = "Podaj swoje imię!";
var blad_email		= "Podaj poprawny adres e-mail!";
var blad_tresc		= "Wpisz treść zapytania!";
var blad_adres		= "Wybierz do kogo chcesz wysłać korespondencję,\nlub wybierz opcję WSZYSCY";
}
else
{
var blad_imie	    = "Please enter your name!";
var blad_email		= "Please enter valid email address!";
var blad_tresc		= "Please enter your question!";
var blad_adres		= "Please choose who you want to contact";
}
var imie			= document.forms['formularz'].imie.value;
var email			= document.forms['formularz'].email.value;
var tresc			= document.forms['formularz'].tresc.value;
var adres1			= document.forms['formularz'].elements["adres[1]"].checked;
var adres2			= document.forms['formularz'].elements["adres[2]"].checked;
var adres3			= document.forms['formularz'].elements["adres[3]"].checked;

text = imie;
if (text.length==0)
{
  document.forms['formularz'].imie.focus(); 
  document.forms['formularz'].imie.select();
  alert(blad_imie); 
  return false;	
}

    text = email;
    if (Wzor_email.test(text)!=true)
	    {
	      alert(blad_email);
		  document.forms['formularz'].email.focus(); 
		  document.forms['formularz'].email.select();
		  return false;
		}

text = tresc;
if (text.length==0)
{
  document.forms['formularz'].tresc.focus(); 
  document.forms['formularz'].tresc.select();
  alert(blad_tresc); 
  return false;	
}

if (!adres1 & !adres2 & !adres3)
{
  alert(blad_adres); 
  return false;	
}
return true; 
}

//---------------------------------------------

function partyinfo(lang)
{
Wzor_email  =/^[0-9a-zA-Z._-]+\@[0-9a-zA-Z_-]+\.[0-9a-zA-Z._]+$/;

if (lang=='pl')
{
var blad_imie	    = "Podaj swoje imię!";
var blad_email		= "Podaj poprawny adres e-mail!";
}
else
{
var blad_imie	    = "Please enter your name!";
var blad_email		= "Please enter valid email address!";
}
var imie			= document.forms['formularz'].imie.value;
var email			= document.forms['formularz'].email.value;

text = imie;
if (text.length==0)
{
  document.forms['formularz'].imie.focus(); 
  document.forms['formularz'].imie.select();
  alert(blad_imie); 
  return false;	
}

text = email;
if (Wzor_email.test(text)!=true)
{
	document.forms['formularz'].email.focus(); 
	document.forms['formularz'].email.select();
	alert(blad_email);
	return false;
}
return true; 
}


//--------------------------------------------------


function booking(lang)
{



Wzor_email  =/^[0-9a-zA-Z._-]+\@[0-9a-zA-Z_-]+\.[0-9a-zA-Z._]+$/;

if (lang=='pl')
{
var blad_organizator				=	"Proszę wypełnić pole ORGANIZATOR!";
var blad_osoba_kontaktowa			=	"Proszę wypełnić pole OSOBA KONTAKTOWA!";
var blad_adres_organizatora			=	"Proszę wypełnić pole ADRES ORGANIZATORA!";
var blad_kod						=	"Proszę wypełnić pole KOD POCZTOWY ORGANIZATORA!";
var blad_miasto						=	"Proszę wypełnić pole MIASTO ORGANIZATORA!";
var blad_nip						=	"Proszę wypełnić pole NIP ORGANIZATORA!";
var blad_telefon					=	"Proszę wypełnić pole TELEFON ORGANIZATORA!";
var blad_fax						=	"Proszę wypełnić pole FAX ORGANIZATORA!";
var blad_email						=	"Proszę wypełnić pole E-MAIL ORGANIZATORA!";
var blad_email2						=	"Pole E-MAIL ORGANIZATORA zostało wypełnione NIEPOPRAWNIE!";

var blad_klub_impreza				=	"Proszę wypełnić pole NAZWA KLUBU/IMPREZY!";
var blad_adres_imprezy				=	"Proszę wypełnić pole ADRES KLUBU/IMPREZY!";
var blad_miasto_imprezy				=	"Proszę wypełnić pole MIASTO KLUBU/IMPREZY!";
var blad_kod_imprezy				=	"Proszę wypełnić pole KOD POCZTOWY KLUBU/IMPREZY!";
var blad_wojewodztwo		=	"Proszę wypełnić pole WOJEWÓDZTWO KLUBU/IMPREZY!";
var blad_wielkosc_klubu				=	"Proszę wybrać ORIENTACYJNĄ WIELKOŚĆ KLUBU/IMPREZY!";
var blad_ilosc_sal					=	"Proszę wybrać ILOŚĆ SAL/SCEN IMPREZY!";
var blad_preferencje_muzyczne		=	"Proszę wybrać PREFERENCJE MUZYCZNE KLUBU/IMPREZY!";
var blad_czas_trwania				=	"Proszę wybrać CZAS TRWANIA IMPREZY!";
var blad_cena_biletu				=	"Proszę wybrać CENĘ BILETU!";

var blad_dje						=	"Proszę wybrać DJA, którego chce się zabookować!";

var blad_data_imprezy				=	"Proszę wybrać DATĘ IMPREZY!";
var blad_proponowane_honorarium		=	"Proszę wpisać PROPONOWANE HONORARIUM!";
var blad_dlugosc_setu				=	"Proszę wybrać DŁUGOŚĆ SETU!";


}
else
{
var blad_imie	    = "Please enter your name!";
var blad_email		= "Please enter valid email address!";
}

var organizator					= document.forms['formularz'].organizator.value;
var osoba_kontaktowa			= document.forms['formularz'].osoba_kontaktowa.value;
var adres_organizatora			= document.forms['formularz'].adres_organizatora.value;
var kod							= document.forms['formularz'].kod.value;
var miasto						= document.forms['formularz'].miasto.value;
var nip							= document.forms['formularz'].nip.value;
var telefon						= document.forms['formularz'].telefon.value;
var fax							= document.forms['formularz'].fax.value;
var telefon_komorkowy			= document.forms['formularz'].telefon_komorkowy.value;
var email						= document.forms['formularz'].email.value;

var klub_impreza				= document.forms['formularz'].klub_impreza.value;
var adres_imprezy				= document.forms['formularz'].adres_imprezy.value;
var miasto_imprezy				= document.forms['formularz'].miasto_imprezy.value;
var kod_imprezy					= document.forms['formularz'].kod_imprezy.value;
var wojewodztwo					= document.forms['formularz'].wojewodztwo.value;
var wielkosc_klubu				= document.forms['formularz'].wielkosc_klubu.value;
var ilosc_sal					= document.forms['formularz'].ilosc_sal.value;
var preferencje_muzyczne		= document.forms['formularz'].preferencje_muzyczne.value;
var czas_trwania				= document.forms['formularz'].czas_trwania.value;
var cena_biletu					= document.forms['formularz'].cena_biletu.value;
	
var adres1						= document.forms['formularz'].elements["adres[1]"].checked;
var adres2						= document.forms['formularz'].elements["adres[2]"].checked;
var adres3						= document.forms['formularz'].elements["adres[3]"].checked;

var data_imprezy				= document.forms['formularz'].data_imprezy.value;
var proponowane_honorarium		= document.forms['formularz'].proponowane_honorarium.value;
var dlugosc_setu				= document.forms['formularz'].dlugosc_setu.value;

text = organizator;
if (text.length==0)
{
  document.forms['formularz'].organizator.focus(); 
  document.forms['formularz'].organizator.select();
  alert(blad_organizator); 
  return false;	
}

text = osoba_kontaktowa;
if (text.length==0)
{
  document.forms['formularz'].osoba_kontaktowa.focus(); 
  document.forms['formularz'].osoba_kontaktowa.select();
  alert(blad_osoba_kontaktowa); 
  return false;	
}

text = adres_organizatora;
if (text.length==0)
{
  document.forms['formularz'].adres_organizatora.focus(); 
  document.forms['formularz'].adres_organizatora.select();
  alert(blad_adres_organizatora); 
  return false;	
}

text = kod;
if (text.length==0)
{
  document.forms['formularz'].kod.focus(); 
  document.forms['formularz'].kod.select();
  alert(blad_kod); 
  return false;	
}

text = miasto;
if (text.length==0)
{
  document.forms['formularz'].miasto.focus(); 
  document.forms['formularz'].miasto.select();
  alert(blad_miasto); 
  return false;	
}

text = nip;
if (text.length==0)
{
  document.forms['formularz'].nip.focus(); 
  document.forms['formularz'].nip.select();
  alert(blad_nip); 
  return false;	
}

text = telefon;
if (text.length==0)
{
  document.forms['formularz'].telefon.focus(); 
  document.forms['formularz'].telefon.select();
  alert(blad_telefon); 
  return false;	
}

text = fax;
if (text.length==0)
{
  document.forms['formularz'].fax.focus(); 
  document.forms['formularz'].fax.select();
  alert(blad_fax); 
  return false;	
}

text = email;
if (text.length==0)
{
  document.forms['formularz'].email.focus(); 
  document.forms['formularz'].email.select();
  alert(blad_email); 
  return false;	
}

if (Wzor_email.test(text)!=true)
{
  document.forms['formularz'].email.focus(); 
  document.forms['formularz'].email.select();
  alert(blad_email2); 
  return false;	
}



text = klub_impreza;
if (text.length==0)
{
  document.forms['formularz'].klub_impreza.focus(); 
  document.forms['formularz'].klub_impreza.select();
  alert(blad_klub_impreza); 
  return false;	
}

text = adres_imprezy;
if (text.length==0)
{
  document.forms['formularz'].adres_imprezy.focus(); 
  document.forms['formularz'].adres_imprezy.select();
  alert(blad_adres_imprezy); 
  return false;	
}

text = miasto_imprezy;
if (text.length==0)
{
  document.forms['formularz'].miasto_imprezy.focus(); 
  document.forms['formularz'].miasto_imprezy.select();
  alert(blad_miasto_imprezy); 
  return false;	
}

text = kod_imprezy;
if (text.length==0)
{
  document.forms['formularz'].kod_imprezy.focus(); 
  document.forms['formularz'].kod_imprezy.select();
  alert(blad_kod_imprezy); 
  return false;	
}

text = wojewodztwo;
if (text.length==0)
{
  document.forms['formularz'].wojewodztwo.focus(); 
  document.forms['formularz'].wojewodztwo.select();
  alert(blad_wojewodztwo); 
  return false;	
}

text = wielkosc_klubu;
if (text.length==0)
{
  document.forms['formularz'].wielkosc_klubu.focus(); 
//  document.forms['formularz'].wielkosc_klubu.select();
  alert(blad_wielkosc_klubu); 
  return false;	
}

text = ilosc_sal;
if (text.length==0)
{
  document.forms['formularz'].ilosc_sal.focus(); 
//  document.forms['formularz'].ilosc_sal.select();
  alert(blad_ilosc_sal); 
  return false;	
}

text = preferencje_muzyczne;
if (text.length==0)
{
  document.forms['formularz'].preferencje_muzyczne.focus(); 
//  document.forms['formularz'].preferencje_muzyczne.select();
  alert(blad_preferencje_muzyczne); 
  return false;	
}

text = czas_trwania;
if (text.length==0)
{
  document.forms['formularz'].czas_trwania.focus(); 
//  document.forms['formularz'].czas_trwania.select();
  alert(blad_czas_trwania); 
  return false;	
}

text = cena_biletu;
if (text.length==0)
{
  document.forms['formularz'].cena_biletu.focus(); 
  document.forms['formularz'].cena_biletu.select();
  alert(blad_cena_biletu); 
  return false;	
}
if (!adres1 & !adres2 & !adres3)
{
  alert(blad_dje); 
  return false;	
}
text = data_imprezy;
if (text.length==0)
{
  document.forms['formularz'].data_imprezy.focus(); 
  document.forms['formularz'].data_imprezy.select();
  alert(blad_data_imprezy); 
  return false;	
}
text = proponowane_honorarium;
if (text.length==0)
{
  document.forms['formularz'].proponowane_honorarium.focus(); 
  document.forms['formularz'].proponowane_honorarium.select();
  alert(blad_proponowane_honorarium); 
  return false;	
}
text = dlugosc_setu;
if (text.length==0)
{
  document.forms['formularz'].dlugosc_setu.focus(); 
//  document.forms['formularz'].dlugosc_setu.select();
  alert(blad_dlugosc_setu); 
  return false;	
}
return true;

}


//--------------------------------------------------


//resize

/*****
* [resizewin.js] v2.1
* 2001-08-05
* Author: Anarchos
* URL: http://anarchos.xs.mw/
***/

function resizeWin(maxX,maxY,speed,delay,win){
	this.obj = "resizeWin" + (resizeWin.count++);
	eval(this.obj + "=this");
	if (!win)     this.win = self;    else this.win = eval(win);
	if (!maxX)    this.maxX = 400;    else this.maxX = maxX;
	if (!maxY)    this.maxY = 300;    else this.maxY = maxY;
	if (!speed)   this.speed = 1/7;   else this.speed = 1/speed;
	if (!delay)   this.delay = 30;    else this.delay = delay;
	this.doResize = (document.all || document.getElementById);
	this.stayCentered = false;
	
	this.initWin = 	function(){
		if (this.doResize){
			this.resizeMe();
			}
		else {
			this.win.resizeTo(this.maxX + 10, this.maxY - 20);
			}
		}

	this.resizeMe = function(){
		this.win.focus();
		this.updateMe();
		}
	
	this.resizeTo = function(x,y){
		this.maxX = x;
		this.maxY = y;
		this.resizeMe();
		}
		
	this.stayCentered = function(){
		this.stayCentered = true;
		}

	this.updateMe = function(){
		this.resizing = true;
		var x = Math.ceil((this.maxX - this.getX()) * this.speed);
		var y = Math.ceil((this.maxY - this.getY()) * this.speed);
		if (x == 0 && this.getX() != this.maxX) {
			if (this.getX() > this.maxX) x = -1;
			else  x = 1;
			}
		if (y == 0 && this.getY() != this.maxY){
			if (this.getY() > this.maxY) y = -1;
			else y = 1;
			}
		if (x == 0 && y == 0) {
			this.resizing = false;
    		}
		else {
			this.win.top.resizeBy(parseInt(x),parseInt(y));
			if (this.stayCentered == true) this.win.moveTo((screen.width - this.getX()) / 2,(screen.height - this.getY()) / 2);
			setTimeout(this.obj + '.updateMe()',this.delay)
			}
		}
		
	this.write =  function(text){
		if (document.all && this.win.document.all["coords"]) this.win.document.all["coords"].innerHTML = text;
		else if (document.getElementById && this.win.document.getElementById("coords")) this.win.document.getElementById("coords").innerHTML = text;
		}
		
	this.getX =  function(){
		if (document.all) return (this.win.top.document.body.clientWidth + 10)
		else if (document.getElementById)
			return this.win.top.outerWidth;
		else return this.win.top.outerWidth - 12;
	}
	
	this.getY = function(){
		if (document.all) return (this.win.top.document.body.clientHeight + 29)
		else if (document.getElementById)
			return this.win.top.outerHeight;
		else return this.win.top.outerHeight - 31; 
	}
	
	this.onResize =  function(){
		if (this.doResize){
			if (!this.resizing) this.resizeMe();
			}
		}

	return this;
}
resizeWin.count = 0;



//----------------------------------------
function deliverActiveX(content)
{
	//alert('in');
	document.write(content);	
}