function OpenShop(){
	document.location='<%=response.encodeURL("?m=101")%>';
}

function OpenPos(indeks){
	document.location="?m=106&indeks="+indeks;
}

function goSearch(){
	document.mw_searchForm.submit();
}

function MM_openBrWindow1(theURL,winName){
	Win = window.open('',winName,'status=yes,scrollbars=yes,width=260,height=480');
	Win.focus();
	sHtml = '<BODY>' + 
			'<center>'	+
			'<table><tr><td height="420" valign=middle align=center>' +
			'<h2><AZ:locText key="_.jsp.main.27">Pobieranie listy wydawców...</AZ:locText></h2>' + 
			'</td></tr></table>';
	Win.document.writeln(sHtml);
	Win.document.location=theURL;
}
function opennw(url, name){
	mywin = window.open('',name,'resizable,status=yes,scrollbars=yes,width=300,height=480');
	var tmp = '';
	tmp = mywin.location.href;
	if(tmp.indexOf(url) == -1){
		mywin.focus();
		sHtml = '<html><body><h2>Pobieranie listy...<\/h2><\/body><\/html>' 
		mywin.document.writeln(sHtml);
		mywin.location=url;
	}
	else{
		mywin.focus();
	}
}

function opedu(url){
	edutree = window.open('','edutree','resizable,status=yes,scrollbars=yes,width=300,height=480');
	var tmp = '';
	tmp = edutree.location.href;
	if(tmp.indexOf(url) == -1){
		edutree.focus();
		sHtml = '<BODY>' + 
				'<center>'	+
				'<table><tr><td height="420" valign=middle align=center>' +
				'<h2>Pobieranie listy...</h2>' + 
				'</td></tr></table>';
		edutree.document.writeln(sHtml);
		edutree.location=url;
	}
	else{
		edutree.focus();
	}
}

function hidebox(id){
	document.getElementById(id).style.display = 'none';
}
function hidebox(id){
	document.getElementById(id).style.display = 'block';
}
function togglebox(id){
	var box = document.getElementById(id);
	if (box.style.display == 'none')
		box.style.display = 'block';
	else
		box.style.display = 'none';
}

function togbox(id, fadein) {
  var elem, vis;
	elem = getElemById(id);
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
    
  
  if(vis.display==''||vis.display=='block'){
	  vis.display = 'none';
  } else {
  	if(fadein == true) setOpacity(id, 0);
		vis.display = 'block';
  	if(fadein == true) fadeIn(id);
	}
  
}

function setOpacity(id, value ) {
  var elem, vis;
	elem = getElemById(id);
  vis = elem.style;

 vis.opacity = value / 10;
 vis.filter = 'alpha(opacity=' + value * 10 + ')';
}

function fadeIn(id) {
 for( var i = 0 ; i <= 100 ; i++ )
   setTimeout( "setOpacity('" + id + "', " + (i / 10) + ')', 8 * i );
}

function getElemById(id){
  var elem;
  if( document.getElementById )
    elem = document.getElementById( id );
  else if( document.all )
      elem = document.all[id];
  else if( document.layers )
    elem = document.layers[id];
  return elem;
}
