function Is() {
	agent  = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns    = ((agent.indexOf('mozilla') != -1) && 
		((agent.indexOf('spoofer')  ==   -1) && (agent.indexOf('compatible') == -1)));
	this.ns4   = (this.ns && (this.major == 4));
	this.ns6   = (this.ns && (this.major >= 5));
	this.ie    = (agent.indexOf("msie") != -1);
	this.ie3   = (this.ie && (this.major  < 4));
	this.ie4   = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") == -1));
	this.ie5   = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1));
	this.ie55  = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5") != -1));
	this.ie6  = (this.ie && (agent.indexOf("msie 6.0")!=-1) );
	this.op = !!(window.opera && document.getElementById);
}

function self_resize() {
	if(is.ns) {
		iWidth = innerWidth;
		iHeight = innerHeight;
	}
	else if(is.ie6) {
		iWidth = document.documentElement.clientWidth;
		iHeight = document.documentElement.clientHeight;
	}
	else {
		iWidth = document.body.clientWidth;
		iHeight = document.body.clientHeight;
	}
	iWidth = 755 - iWidth;
	iHeight = 531 - iHeight;
	window.resizeBy(iWidth, iHeight);
	self.focus();
};

function uploadFile() {
  var oLocalObj = document.getElementById("uploading");
  oLocalObj.style.visibility="visible";
  document.forms[0].submit();
}

function processFile() {
  var oLocalObj = document.getElementById("processing");
  oLocalObj.style.visibility="visible";
	document.forms[1].submit();
}

function processFilter() {
  var oLocalObj = document.getElementById("processing");
  oLocalObj.style.visibility="visible";
}

function openHelp(sHelpId,sTheme)
{
//	var sBaseUrl = "http://tapeciarz.mobile.net.pl/help.xhtml";
	var sBaseUrl = "/help.xhtml";
//	window.open(sBaseUrl + "?theme=" + sTheme + "#" + sHelpId,"Tapeciarz pomoc");
//	window.open(sBaseUrl + "?theme=" + sTheme + "#" + sHelpId,"Tapeciarz pomoc","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=755, height=531");
	opener.location.href = sBaseUrl + "?theme=" + sTheme + "#" + sHelpId;
	opener.focus();
}

/* ponizsza funkcja do wywalenia po zmianie na wszystkich templatach*/
function uploading() {
	var oLocalObj = document.getElementById("uploading");
	oLocalObj.style.visibility="visible";
}

/* ponizsza funkcja do wywalenia po zmianie na wszystkich templatach*/
function processing() {
	var oLocalObj = document.getElementById("processing");
	oLocalObj.style.visibility="visible";
}

document.oncontextmenu=new Function("return false");

var is = new Is();