/*window.onload=showSubNav;*/
function showSubNav(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=2; i++) {
		if (document.getElementById('subNav'+i)) {document.getElementById('subNav'+i).style.display='none';}
	}

if (d) {
		d.style.display='block';
	}

}


function doPic(imgId,x,y,bigImg) 
{ 
 imgOn = ("" + imgId); 
 document.mainpic.src = imgOn;  
 document.mainpic.style.display = ''; 
 
 var mainPicLink=document.getElementById('mainPicLink');
 mainPicLink.href='javascript:galeria('+x+','+y+',\''+bigImg+'\');';
 //alert(document.mainpic.onClick);
}

function fullwindow(x,y,url)
{
	okno = 'width=' + x + ',height=' + y + ',toolbar=no,left='+(screen.availWidth-x)/2+',top='+(screen.availHeight-y)/2+',status=1,scrollbars=1';
	with(window.open(url, '', okno))
	{
	focus();
	}
}
 
function UrlReplace(link,param1)
{
	link=link.replace('*param1*',param1);
	document.location=link;
} 


function koszyk_przelicz(id)
{
	var formularz=document.getElementById('koszyk_form');
	var action=document.getElementById('koszyk_action');
	var param=document.getElementById('koszyk_param');
	action.value='przelicz';
	param.value=id;
	formularz.submit();
	return false;
}


function koszyk_usun(id)
{
	var formularz=document.getElementById('koszyk_form');
	var action=document.getElementById('koszyk_action');
	var param=document.getElementById('koszyk_param');
	action.value='usun';
	param.value=id;
	formularz.submit();
	return false;
	
} 




function galeria(w, h, src){
  if(window.screen){
    aw=screen.availWidth;
    ah=screen.availHeight;
  }else{
    aw=640;
    ah=450;
  }
   ustawienia=
     "left=" + (aw-w)/2 + ","
    +"top=" + (ah-h)/2 + ","
    +"screenX=" + (aw-w)/2 + ","
    +"screenY=" + (ah-h)/2 + ","
    +"width=" + w + ","
    +"height=" + h + ","
    +"innerWidth=" + w + ","
    +"innerHeight=" + h + ","
    +"toolbar=no,"
    +"location=no,"
    +"directories=no,"
    +"status=no,"
    +"menubar=no,"
    +"scrollbars=no,"
    +"resizable=no"
  noweOkienko = window.open('','',ustawienia);
  noweOkienko.document.open();
  noweOkienko.document.clear();
  noweOkienko.document.write(
     "<html><head>\n"
	+"<title>Adrenalina</title>\n" 
    +"<style><!--\n"
    +"body{background-repeat:no-repeat}\n"
    +"--></style>\n"
    +"</head>\n"
    +"<body background='" + src + "'></body>\n"
    +"</html>"
  );
  noweOkienko.document.close();
  noweOkienko.focus();
}

