function sFlash(w, h, path)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'">'
+'<param name="movie" value="'+path+'" />'
+'<param name="quality" value="high" />'
+'<param name="menu" value="0" />'
+'<embed src="'+path+'" width="'+w+'" height="'+h+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="0"></embed>'
+'</object>');
}
// tylko dla okna do moderacji
function displayPusty(url) {
        var Win =
window.open(url,"displayWindow",'width=350,height=301,left=200,top=170,resizable=0,scrollbars=no,menubar=no');}
//
function OpenNewWindowWH(mypage,w,h,myname){
var win_wh= null;
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no'
win_wh=window.open(mypage,myname,settings)
if(parseInt(navigator.appVersion) >= 4){win_wh.window.focus();}
}
//
function validate()
{
	conf = confirm("Aby potwierdzić, kliknij na OK");
	if (conf)
		return true
	else
		return false;
}
//
function full(id){
window.open('full.php3?ig='+id, '', 'fullscreen=yes, scrollbars=no');
}
//============================
var PLATNE;
var ZNAKI_P=1000;
var ZNAKI_B=500;
function pozostalo_znakow(f,tf,x){
	if (x==0)
		{
		if (PLATNE==1) { x=ZNAKI_P; } else { x=ZNAKI_B; }
		}
      	tf.value = x-f.value.length;
}
//=============================
function check_dl(f,x){
	if (x==0)
		{
		if (PLATNE==1) { x=ZNAKI_P; } else { x=ZNAKI_B; }
		}
  	if (f.value.length>x) {
   		alert("Można wpisac tylko "+x+" znakow!");
   		f.value = f.value.substr(0,x)
//   f.disabled=true;
//document.write(x);
  		}
}
//===========================
function wyslijMaila(uzytkownik, serwer, r){
   if (r=="O"){
   		location.href = "mailto:" + uzytkownik + "@" + serwer + "?subject=Zapytanie dot. ogloszenia na portEl.pl";
		}
   if (r=="A"){
                location.href = "mailto:" + uzytkownik + "@" + serwer + "?subject=Kontakt poprzez portEl.pl";
                }
}
//------------------------
function show_fotoDiv(n,l,id){
        var nagDiv = document.getElementById("nagDiv");
        var fotoDiv0 = document.getElementById("fotoDiv0");
        var nag="";
        var nxt="";
	var pr;
	var nx;
	var cl;
        n = parseInt(n);
	l = parseInt(l);
	pr = n - 1; 
	if (pr<1) { pr=1; }	
	nx = n + 1;
	if (nx>l) { nx=l; }
        fotoDiv.style.display="block";
        var fotka="oglimg/" + n + "/z" + id + ".jpg";

        fotoDiv0.innerHTML="<img src=" + fotka + " border=\"0\" align=\"middle\" alt=\"Ogłoszenie\" />";
        nag = "Zdjęcia do ogłoszenia nr " + id;
        if (l>1) {
		if (n>1){
	        nxt = "<input type=\"button\" value=\"<<\" style=\"width:25px;cursor: pointer; cursor: hand; margin-left: 7px;\" onclick=\"show_fotoDiv("+pr+","+l+","+id+");\">";
			}
        for (var k = 1; k <= l; ++k) {

	if (k==n) { cl="color: green; font-weight: bold;" } else { cl=""; }
        nxt = nxt + "<input type=\"button\" value=\"" + k + "\" style=\"width:15px;cursor: pointer; cursor: hand; margin-left: 7px;" + cl + "\"  onclick=\"show_fotoDiv("+k+","+l+","+id+");\">";
                }

		if (n<l){
                nxt = nxt + "<input type=\"button\" value=\">>\" style=\"width:25px;cursor: pointer; cursor: hand; margin-left: 7px;\" onclick=\"show_fotoDiv("+nx+","+l+","+id+");\">";
			}

        nag = nag + ":  " + nxt;
                }
        nagDiv.innerHTML = nag + "<input type=\"button\" value=\"Zamknij\" style=\"width:55px;color: red; cursor: pointer; cursor: hand; margin-left: 27px;\"  onclick=\"close_fotoDiv();\">";
return;
}
//---------------------
function close_fotoDiv(){
        fotoDiv.style.display="none";
}

