var innertxt="";
var created;
var h;
var w;
var whichD;
var whichD1;
var whichDiv;
var whichDiv1;
whichDiv = "SelectBox";
whichDiv1 = "InnerBox";
function showdiv(url,w,h,e,id)
{
	 var posx = 0;
	 var posy = 0;
	 whichD = whichDiv;
	 whichD1 = whichDiv1;
	 posx = (screen.width-w)/2;

	 if (!e) var e = window.event;
	 if 	(e.pageY) 	posy = e.pageY;
	 else if (e.clientY)	posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	 posy = posy - 150;
	 document.getElementById(whichDiv).style.left = posx + "px";
	 document.getElementById(whichDiv).style.top = posy + "px";
	 document.getElementById(whichDiv).style.width = w + "px";
	 document.getElementById(whichDiv).style.height = h+110 + "px";
	 document.getElementById(whichDiv1).style.width = (w-35) + "px";
	 document.getElementById(whichDiv1).style.height = h + "px";
	 document.getElementById("loaderbox").style.height = h + "px";
	 document.getElementById(whichDiv).style.display = (document.getElementById(whichDiv).style.display == "none") ? "block" : "none";
	 document.getElementById("loaderbox").style.display = "block";						
	 url = "http://www.anonser.pl/"+url+".php?id="+id;
         try {xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");}  catch (e) { alert("Error: Could not load page.");}
         document.getElementById("loaderbox").innerHTML = "<br /><br /><br /><center><img src='http://www.panoramainternetu.pl/modules/new_glowna/styles/standard/loader.gif' border=0 alt='' /><br /><span style='font-family: verdana,tahome,arial; font-size: 12px'>Trwa ladowanie</span></center>";
         xmlhttp.onreadystatechange = function(){
                 if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
			document.getElementById("loaderbox").style.display = "none";						
			if (created != 1)
                                document.getElementById(whichDiv1).innerHTML = "<iframe src='' name=tresc id=tresc width=386 height=100% frameborder=0></iframe>";
			window.frames['tresc'].document.writeln(xmlhttp.responseText);
			window.frames['tresc'].document.close();
			created = 1;	
                 }
         }

         xmlhttp.open("GET", url);
         xmlhttp.send(null);
	 
         return false;
}
function sel()
{	
	document.getElementById(whichDiv).style.display  = "none";
}
function ShowMore(nr)
{
	 document.getElementById("more_"+nr).style.display = (document.getElementById("more_"+nr).style.display == "none") ? "block" : "none";
	 if (document.getElementById("more_"+nr).innerHTML == "")
	 {
	    document.getElementById("moreloaderbox_"+nr).style.display = "block";						
	    url = "http://katalog.anonser.pl/showmore.php?nr="+nr;
            try {xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");}  catch (e) { alert("Error: Could not load page.");}
            document.getElementById("moreloaderbox_"+nr).innerHTML = "<br /><br /><center><img src='http://www.panoramainternetu.pl/modules/new_glowna/styles/standard/loader.gif' border=0 alt='' /><br /><span style='font-family: verdana,tahome,arial; font-size: 12px'>Trwa ladowanie</span></center>";
            xmlhttp.onreadystatechange = function(){
                 if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
			document.getElementById("moreloaderbox_"+nr).style.display = "none";						
                        document.getElementById("more_"+nr).innerHTML = xmlhttp.responseText;
                 }
            }
            xmlhttp.open("GET", url);
    	    xmlhttp.send(null);
	}
        return false;
}


