function insertFlashElem(name, w, h) {
	var path = './flash/'+name;
	var toWrite = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">';
	toWrite += '<param name="allowScriptAccess" value="sameDomain" />';
	toWrite += '<param name="movie" value="'+path+'" />';
	toWrite += '<param name="quality" value="autohigh">';
	toWrite += '<param name="wmode" value="opaque" >';
	toWrite += '<param name="wmode" value="transparent" >';
	toWrite += '<embed wmode="transparent" src="'+path+'" quality="high" width="'+w+'" height="'+h+'" name="baner" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	toWrite += '<'+ '/'+'object>';
	document.write(toWrite);
}

function switchImagesOn(id, mid)
  {
    var oImg = document.getElementById('pic_'+id+'a');
	var div = document.getElementById('menu_'+mid);
    oImg.src = './img/top/'+id+'.jpg';
	div.style.background='#D9AD9C'; 
}
function switchImagesOff(id, mid)
  {
    var oImg = document.getElementById('pic_'+id+'a');
    var div = document.getElementById('menu_'+mid);
	oImg.src = './img/top/'+id+'a.jpg';
	div.style.background='';
  }
  
function getMousePosition(e) 
	{ 
	return e.pageX ? {'x':e.pageX, 'y':e.pageY} : {'x':e.clientX + document.documentElement.scrollLeft + document.body.scrollLeft, 'y':e.clientY + document.documentElement.scrollTop + document.body.scrollTop}; 
	}; 
	
function showMousePos(e) {
	if (!e) e = event; 
	// make sure we have a reference to the event 
	var input = document.getElementById('mydiv'); 
	var mp = getMousePosition(e); 
	//input.style.top = mp.y;
	//input.style.left = mp.x;
	//input.innerHTML = 'x : ' + mp.x + ', y : ' + mp.y; 
	
	mousePos = new Array(mp.x,mp.y) 
	return mousePos;	
	}; 

document.onmousemove = showMousePos; 


function getPageSize(){
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;		
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	} 	
	
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}



function showBigImg(url, w, h)
{
	psize = getPageSize();
	
	var obj = document.getElementById('big_img');
	var img_cont = document.getElementById('img_cont');
	var span = document.getElementById('img');
	
	obj.style.position = 'absolute'; 
	obj.style.width = navigator.appName == "Microsoft Internet Explorer" ? psize[0] : psize[0]-21; 
	obj.style.height=psize[1];
	
	img_cont.style.top = psize[1]/2 - h/2;
	img_cont.style.left = psize[0]/2 - w/2;											
	img_cont.style.display = 'block';
	obj.style.display = 'block'; //desc_src.value

	span.innerHTML = "<img src='"+url+"' width='"+w+"' height='"+h+"'>";
}


function closeBIgImg()
{
	var obj = document.getElementById('big_img');
	if(obj.style.display == 'block'){
		obj.style.display = 'none';
		img_cont.style.display = 'none';
		document.getElementById('img').innerHTML = '';
		document.getElementById('description_place').innerHTML = '';
	}
}


function show_form(div)
{
	var divv = document.getElementById(div);
	divv.style.display = 'block';
	divv.style.top = tempY;
}

function hide_form(div)
{
	var divv = document.getElementById(div);
	divv.style.display = 'none';
}

function gotoPage ( page )
{
   
        window.open ( page , '_self' );
}






//-------------------------------------------------------------------------------
// Podmienia grafikê w podanym znaczniku <img>

function change ( id, image )
{
    window.document.images[id].src=image;
}


  
  
  //wy¶wietlanie linku do maila, zapobiegaj±cego robotom
  <!--
  function antyRobotMail(user, host, opis)
  {	
	var dodatkowe = "";
	document.write('<A HR' + 'EF="mai' + 'lto:' + user + '\x40' + host + dodatkowe + '">');
	if (opis) document.write(opis + '<'+'/A>');
	else document.write(user + '\x40' + host + '<'+'/A>');
  }
 //-->
 
 	function showMenu(id, top_cnt, left_cnt)
    {
	   var obj = document.getElementById('podstron_'+id);
	   var img = document.getElementById('pic_'+id);
		if(obj.style.display == 'none'){
        obj.style.display = 'block';
		obj.style.left = (screen.width/2 - 400) + (left_cnt*180);
		obj.style.top = 270 + (top_cnt-1)*15;

//	   alert((screen.width/2 - 400) + (left_cnt*180));
	  // alert(270 + (top_cnt-1)*15);
	   
		img.src = 'img/menu/minus.gif';
		}
		else {
		obj.style.display = 'none';
		img.src = 'img/menu/plus.gif';
		}
    }
	
	var TempId=0;
	
	function showMenuH(id, top)
    {
       var obj = document.getElementById('podstron_'+id);
	   var img = document.getElementById('pic_'+id);
		if(TempId!=0 && TempId!=id){
			var root = document.getElementById('podstron_'+TempId);
			var root_img = document.getElementById('pic_'+TempId);
			root.style.display='none';
			root_img.src = 'img/menu/plus.gif';
			
		}
		if(obj.style.display == 'none'){
        obj.style.display = 'block';
		obj.style.top=top;
		obj.style.left = tempX;
		img.src = 'img/menu/minus.gif';
		}
		else {
		obj.style.display = 'none';
		img.src = 'img/menu/plus.gif';
		}
		TempId=id;
    }	
	
	function closeOpen()
	{
		if(TempId!=0){
			var root = document.getElementById('podstron_'+TempId);
			var root_img = document.getElementById('pic_'+TempId);
			root.style.display='none';
			root_img.src = 'img/menu/plus.gif';
			TempId=0;
		}
	}
	

/********************************************************************/
/************************admin***************************************/
function removeAsk ( module, id, question )
{
    if ( confirm ( 'Czy na pewno chcesz usun±æ ' + question + '?' ))
	 window.open ( '?cmd=' + module + '_del&id=' + id , '_self' );
}

function removeAskSpecjal ( module, action, id, param, question )
{
    if ( confirm ( 'Czy na pewno chcesz usun±æ ' + question + '?' ))
        window.open ( '?cmd=' + module + '_' + action + param + '&id=' + id , '_self' );
}


//zwija rozwija drzewo katalogowe strony
function flipTree(oImg, id)
  {
    var obj = document.getElementById(id);
    if (obj.style.display == 'block')
    {
      obj.style.display = 'none';
      oImg.src = 'img/folder_open.gif';
    }
    else
    {
      obj.style.display = 'block';
      oImg.src = 'img/folder_close.gif';
    }
    
  }


//zmiana kolejnosci wyswietlania 
  function moveDown(sId)
  {
    var oTable = document.getElementById('order_table');
    var aRows = oTable.getElementsByTagName('tr'); // zignorowac pierwszy bo to nagÅ‚Ã³wek
	
    // sprawdzamy numer wiersza dla danego id
    var iRowNr = 0;
    for (i = 1; i < aRows.length; i++)
      if (aRows[i].id.substring(11) == sId) iRowNr = i;

    // najpierw sprawdzamy czy to nie jest przypadkiem na samym dole
    if (iRowNr == aRows.length-1) return;

// zaczynamy zamienianie wierszy
    var aCellsOne = aRows[iRowNr].getElementsByTagName('td');
    var aCellsTwo = aRows[iRowNr+1].getElementsByTagName('td');
	
    for (i = 0; i < aCellsOne.length; i++)
    {
      if (i==0 || i == 7 || i == 8) continue; // omijamy kolumny ze strzalkami
      var sTmp = aCellsOne[i].innerHTML;
      aCellsOne[i].innerHTML = aCellsTwo[i].innerHTML;
      aCellsTwo[i].innerHTML = sTmp;
    }
  setOrders();
  }
  function moveUp(sId)
  {
    var oTable = document.getElementById('order_table');
    var aRows = oTable.getElementsByTagName('tr'); // zignorowac pierwszy bo to nagÅ‚Ã³wek

    // sprawdzamy numer wiersza dla danego id
    var iRowNr = 0;
    for (i = 1; i < aRows.length; i++)
      if (aRows[i].id.substring(11) == sId) iRowNr = i;
    
    // najpierw sprawdzamy czy to nie jest przypadkiem na samym dole
    if (iRowNr == 1) return;
    
    // zaczynamy zamienianie wierszy
    var aCellsOne = aRows[iRowNr].getElementsByTagName('td');
    var aCellsTwo = aRows[iRowNr-1].getElementsByTagName('td');
    
    for (i = 0; i < aCellsOne.length; i++)
    {
      if (i==0 || i == 7 || i == 8) continue; // omijamy kolumny ze strzalkami
      var sTmp = aCellsOne[i].innerHTML;
      aCellsOne[i].innerHTML = aCellsTwo[i].innerHTML;
      aCellsTwo[i].innerHTML = sTmp;
    }
	setOrders();
  }
  
  function setOrders()
  {
	  var oTable = document.getElementById('order_table');
      var aRows = oTable.getElementsByTagName('tr');
	  var aFields = oTable.getElementsByTagName('input');
	  for (i = 0; i < aRows.length; i++)
	  	aFields[i].value = (i+1);
  }	
	
	function adminMenuOver(id)
    {
	   var obj = document.getElementById('over_'+id);
	   obj.style.borderTop='1px solid #efefef';
	   obj.style.borderBottom='1px solid #909090';
	   obj.style.borderLeft='1px solid #efefef';
	   obj.style.borderRight='1px solid #909090';	
    }
	
	function adminMenuOut(id)
    {
       var obj = document.getElementById('over_'+id);
	   obj.style.border='1px solid #FFFFFF';
   
    }
	function adminMenuClick(id)
    {
       var obj = document.getElementById('over_'+id);
	   obj.style.borderTop='1px solid #5F5353';
	   obj.style.borderBottom='1px solid #efefef';
	   obj.style.borderLeft='1px solid #5F5353';
	   obj.style.borderRight='1px solid #efefef';
    }	
	
	function adminMenuUnClick(id)
    {
       var obj = document.getElementById('over_'+id);
	   obj.style.borderTop='1px solid #efefef';
	   obj.style.borderBottom='1px solid #909090';
	   obj.style.borderLeft='1px solid #efefef';
	   obj.style.borderRight='1px solid #909090';	
    }		
	
	function showImg(url, w, h)
	{
		var obj = document.getElementById('big_img');
		var span = document.getElementById('img');
		obj.style.position = 'absolute'; 
		obj.style.top=tempY - h/2;
		obj.style.left=(screen.width/2)-(h/2);
		obj.style.width=w;
		obj.style.height=h;	
		span.innerHTML = "<img src='"+url+"' width='"+w+"' height='"+h+"'>";
		obj.style.display = 'block'; 
	}	
	
/********************************************************************/
/************************koniec admin********************************/	
	




