		
var wOpened=0;
function wOpen(URLStr,width,height,left,top){
if(wOpened)
  {
    if(!wOpened.closed) 		wOpened.close();
  }
wOpened = open('', 'wOpened', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
doc=wOpened.document;
doc.write('<html><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-2"><title>GTASite.pl - Galeria (kliknij, aby zamknac okno)</title></head><script language="Javascript">\nfunction start(){\nimg=document.getElementById(\'image\');\nvar sheight=window.opener.innerHeight || screen.availHeight;\nif (img.height>sheight){\n	window.document.body.scroll="yes";\n	window.resizeTo(img.width+15+11,sheight);\n} else {\n	window.resizeTo(img.width+10,img.height+20);\n if (window.document.body.clientHeight<img.height)\n	window.resizeBy(0,img.height-window.document.body.clientHeight);\n}\n}\n<\/script>\n<body bgcolor="#484848" onload="start();" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" onBlur="self.focus();">\n<a href="#" onClick="window.close();"><img id="image" border=0 src="'+URLStr+'" alt=""></body></html>');
doc.close();
}

	function img(img){
		var winl = (screen.width - 0) / 2;
		var wint = (screen.height - 0) / 2;
  	wOpen(img,0,0,winl,wint)
	}
	
function showHide(id) {
        
            obj = document.getElementById(id);
            obj.style.display = (obj.style.display == "block" ? "none" : "block");
        }
function confirmDelete() {
if (confirm('Czy jestes pewien ze chcesz usunac element?')) {
return true;
}
return false;
}
function submit_d(){
	
			advAJAX.assign(document.getElementById("shout_form"), {
    onSuccess : function(obj) {
    var f = document.getElementById('shout');
			f.contentWindow.location.reload(true);
			document.shout_small.tresc.value = '';        
    }});
	
	advAJAX.assign(document.getElementById("shout_form_big"), {
    onSuccess : function(obj) {
    var f = document.getElementById('shout_big');
			f.contentWindow.location.reload(true); 
			document.shout_form_big.tresc.value = '';       
    }});
	

			
		
		}
function SendMessage(){
	var objMessage = document.getElementById('text_small');
	var message = objMessage.value;
	objMessage.value = '';
	
	advAJAX.post({
		url: "postshout.html",
		parameters : {
		  "tresc" : message
		},
		
		onSuccess : function(obj) { document.getElementById('shout_cnt').innerHTML=obj.responseText; }
	});	
}
function subcategories(){
	
	var objMessage = document.getElementById('maincats');
	var message = objMessage.value;
	
	advAJAX.get({
    url: "index.php?act=subcats&id=" + message,
	
    onSuccess : function(obj) { document.getElementById('subcats').innerHTML=obj.responseText; }
});

}
function pobierz()
{
if(document.getElementById('shout_cnt')){
advAJAX.get({
    url: "shout.php",
	
    onSuccess : function(obj) { document.getElementById('shout_cnt').innerHTML=obj.responseText; }
});
setTimeout('pobierz()', 5000);
}
}
function submit_b(){
			advAJAX.submit(document.getElementById('shout_form_big'), {
			onSuccess : function(obj) { 
			var f = document.getElementById('shout_big');
			f.contentWindow.location.reload(true);
			 },
			onError : function(obj) { alert("Error: " + obj.status); }
			});
		}
		
function checkall()
{
var df=document.gbook.elements;
for(var i=0;i<df.length;i++)
{
//alert(df[i].name);
df[i].checked=true;
}
}

function uncheckall()
{
var df=document.gbook.elements;
for(var i=0;i<df.length;i++)
{
//alert(df[i].name);
df[i].checked=false;
}
}
