
function init(){
//	alert(window.innerHeight);
	if(document.getElementById('ar_l')){
		new obj_button('ar_l',Array('ar_l0.gif','ar_l1.gif','ar_l2.gif'),'img/');
		new obj_button('ar_r',Array('ar_r0.gif','ar_r1.gif','ar_r2.gif'),'img/');
	}
	stat();
}



D=document;

function clear_page(){
	document.getElementById("subpage").innerHTML="";
}


function get_subpage(o){
	var url = '/proxy?url=' + encodeURIComponent('http://www.google.com/search?q=Prototype');
	url='pages/'+o.title+'.html';

	var div=document.getElementsByClassName("menu_items");
	if(div!='')div[0].className="menu_item";
	
	o.className="menu_items";

	new Ajax.Request(url, {
		method: 'get',
		onComplete: function(transport){
			var div=document.getElementById('subpage');
			div.innerHTML=transport.responseText;
			return false;
		}
	});
	return false;
}


function obj_button(id,img,path){
	this.id=id;
	this.img=img;
	this.path=path;
	this.node=document.getElementById(this.id);
	this.node.obj=this;
	this.node.onmouseover=function(){
		this.src=this.obj.path+this.obj.img[1];
	};
	this.node.onmouseout=function(){
		this.src=this.obj.path+this.obj.img[0];
	};
	this.node.onmousedown=function(){
		this.src=this.obj.path+this.obj.img[2];
	};
	this.node.onmouseup=function(){
		this.src=this.obj.path+this.obj.img[1];
	};
}



function imgWin(par){
  w=window.open("./img.php?i="+par,"img","resizable=no,scrollbars=no,status=no,width=100,height=100")
	w.focus()
}



function stat(){
	if(navigator.appVersion.indexOf('MSIE')>-1)return false

	with(document.getElementById('stat')){
		style.top=window.innerHeight-15+'px';
		style.left=window.innerWidth-30+'px';
	}
	document.getElementById('stat').onclick=function(o){
		if(!document.ctrlKey)return false;
		if(!confirm('Statystyki dla tego użytkownika zostaną za chwile wyłączone.'))return false;
		window.location='stat.php';
	}
}
document.onmousedown=function(e){
	if(navigator.appVersion.indexOf('MSIE')>-1)return false
	this.ctrlKey=e.ctrlKey;
}

