// Widnows + MINTAJAX APIs
//Sprawdza przeglądarke...
var ie4, ns4, ns6;
ie4=(document.all)&&(parseInt(navigator.appVersion)>=4);
ns4=(document.layers)&&(parseInt(navigator.appVersion)>=4);
ns6=(navigator.product=="Gecko");
//Sprawdza przeglądarke...
if(ie4) {	
var myWidth = screen.width;
var myHeight = screen.height;
//window.self.close();
//window.location="http://www.business.moroko.pl";
}
if(ns4) {
var myHeight = window.innerHeight-10; //Wysokosc scrola
var myWidth = window.innerWidth-18; //Szerokosc scrola
}
if(ns6) {
var myHeight = window.innerHeight-10; //Wysokosc scrola
var myWidth = window.innerWidth-18; //Szerokosc scrola
}

//Funkcja wyzwalacza po zaladowaniu DOMa
window.onDomReady = DomReady;

//IE execute function
function LoadReadyState(fn){
//dom is ready for interaction
if(document.readyState == "interactive"){fn();}
}

function DomReady(fn){
	//W3C
if(document.addEventListener){document.addEventListener("DOMContentLoaded", fn, false);}
	//IE
else{document.onreadystatechange = function(){readyState(fn)}}
}

var indexZ = 1060;
//App_Name = navigator.appName;
//AppC_Name = navigator.appCodeName;
//App_Version = navigator.appVersion;
//alert(" Wysokość = "+myHeight+" Szerokośc = "+myWidth+" Przeglądarka = ");
function autoclick(uiclick){location = uiclick;}
//Funkcja fokusa przenosi kursor do pola	
function fokus(AElementID)
{
    var el = document.getElementById(AElementID);
    el.focus();
}
//Funkcje ukrywacza i pokazywacza
function Show_options_tb(obj,focusID){
	$(obj).style.display="block";
	$(obj).style.visibility="visible";
	//Dodatkowe parametry
	if($(focusID)){ fokus(focusID); }//ustawia kursor w wyszukiwarce filtra...
}
function Hide_options_tb(obj){
	$(obj).style.display="none";
	$(obj).style.visibility="hidden";
}

function Load_Interface(where,what,tytul){
//alert(location.pathname);
if(!$(where)){alert("Brak zdefiniowanego kontenera "+where);}
else{
	name_what = what.replace(".php", "");
	$("static_link").innerHTML = '<a href="http://www.maverick.com.pl'+location.pathname+'?page='+name_what+'">symlink</a>';
 	$(where).innerHTML = '<div style="background:url(img/tyt2.gif) repeat-x bottom; height:51px; line-height:51px; font-size:21px; color:#666; padding-left:10px;">Proszę czekać / <span class="black">Trwa ładowanie interfejsu...</span></div><div style="width:100px; height:100px; text-align:center; line-height:100px; margin:auto;">&nbsp;<img src="img/loading_2.gif" alt="Ładowanie interfejsu..." border="0" align="middle" />&nbsp;</div>';
	$("content").style.cursor = "wait";
	var req = mint.Request();
	req.OnLoading = function(){ $(where).innerHTML = '<div style="background:url(img/tyt2.gif) repeat-x bottom; height:51px; line-height:51px; font-size:21px; color:#666; padding-left:10px;">Proszę czekać / <span class="black">Trwa ładowanie interfejsu...</span></div><div style="width:100px; height:100px; text-align:center; line-height:100px; margin:auto;">&nbsp;<img src="img/loading_2.gif" alt="Ładowanie interfejsu..." border="0" align="middle" />&nbsp;</div>'; }
	req.OnAbort =  function(){ alert("Serwer ma problemy z odebraniem zapytania. Spróbuj ponownie późnej.");}
	req.OnSuccess = function(){
		$(where).innerHTML = this.responseText;
		//if(tytul != ""){$("nazwa_panelu").innerHTML = tytul;}
		$("content").style.cursor = "auto";
		}
	req.Send(what,where);
	}
}