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_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_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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function ulubione() {
	title='Surfmania.pl';
	url='http://www.surfmania.pl/';
	if (window.sidebar) { 
	window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
	window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
	return true;
	}
}

function galeria_user(nr_foto) {
	window.open('/galeria_user_big.php?id_foto='+nr_foto,'galeria','width='+screen.width+',height='+screen.height+',status=yes,scrollbars=yes,menubars=no,resizable=no');
}

function galeria(nr_foto) {
	window.open('/galeria_big.php?id_foto='+nr_foto,'galeria','width='+screen.width+',height='+screen.height+',status=yes,scrollbars=yes,menubars=no,resizable=no');
}
function galeria2(nr_foto,opis) {
	window.open('/galeria_big.php?id_foto='+nr_foto+'&opis='+opis,'galeria','width='+screen.width+',height='+screen.height+',status=yes,scrollbars=yes,menubars=no,resizable=no');
}

function change_page(numer)
{
	adres = '';
	switch (numer)
	{
		case 1: adres = '/newsy_ws.php'; break;
		case 2: adres = '/ekipa.php'; break;
		case 3: adres = '/spot.php'; break;
		case 4: adres = '/linki.php'; break;
		case 5: adres = '/nasze_relacje.php'; break;
		case 6: adres = '/galeria.php'; break;
		case 7: adres = '/filmy.php'; break;
		case 8: adres = '/pogoda.php'; break;
		case 9: adres = '/kontakt.php'; break;		
		case 10: adres = '/forum.php?kat=-1&n=-1&m=-1'; break;		
	}
	if (adres) location = adres;
}
function pogoda() {
	window.open('/pogoda.php','pogoda','width=740,height=600,status=yes,scrollbars=yes,menubars=no,resizable=yes');
}

var tekst_pierwotny="";

function czysc_pole(id){
	tekst_pierwotny = document.getElementById(id).value;
	if((tekst_pierwotny=="login/xywka")||(tekst_pierwotny=="błąd logowania")||(tekst_pierwotny=="hasło")){
		document.getElementById(id).value="";
	}
}

function przywroc_pole(id){
	
	if(document.getElementById(id).value==""){
		document.getElementById(id).value=tekst_pierwotny;
	}
}
function wyslij_loguj(forma_wysylajaca) {
	document.getElementById(forma_wysylajaca).submit();
}

function surfmaniak(login){
	window.open('/surfmaniak.php?login='+login,'Surfmaniak','width=385,height=295,status=yes,scrollbars=no,menubars=no,resizable=no');
}
function potwierdzenie(pytanie){
  if (confirm(pytanie)) {
    return true;
  } else {
    return false;
  } 
 return true;
}


function okno_upload(){
	window.open('/dodaj_fotki.php','Fotki','width=390,height=400,status=yes,scrollbars=yes,resizable=no,menubar=no');
}
