//*****************************************************************************
//  FUNKCJE
//*****************************************************************************
function plikiDodaj()
	{
		showModalDialog('import.php?id='+document.all['id'].value, window,"status: false;scroll: yes;dialogWidth: 600px; dialogHeight: 100px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");
	}

function plikiUsun(id)
	{
		if (id!=',')
			{
				if (confirm('Czy na pewno usun±ć zaznaczone pliki?'))
					{
						xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
						xmlDoc.async="false";
						xmlDoc.load('pliki.php?info='+id);
						
						for(i=document.getElementById('zalaczniki').rows.length*2;i>-1;i--)
							{
								//alert(i);
								if (document.getElementById('zaznacz_'+i))
									{
										if (document.getElementById('zaznacz_'+i).checked==true)
											{
												document.getElementById('zalaczniki').deleteRow(i);
												document.getElementById('zalaczniki').deleteRow(i);
												//alert('skasowano - '+i);
											}
									}
									
							}
						//document.all['pliki_usun'].value=',';
					}
			}
		else
			alert('Brak zaznaczonych plików do usunięcia!');
	}

function plikiZaznacz(pole)
	{
		if (pole.checked==true)
			{
				document.all['pliki_usun'].value+=pole.value+',';
				
			}
		else
			{
				document.all['pliki_usun'].value=document.all['pliki_usun'].value.replace(','+pole.value+',',',');
			}
	}

function strony()
	{
		document.all['logo'].innerHTML='<div align="center"><img src="images/strony.gif" width="41" height="41"></div>';
		document.all['naglowek'].innerHTML='<b>Strony</b>';
		dokumentModul='strony';
		dokumentWidok()
	}

function stronyOtworz()
	{
		alert('Strona została wczytana!');
		  var oEditor = FCKeditorAPI.GetInstance('editor') ;
		oEditor.InsertHtml(xmlDoc.getElementsByTagName("tresc_strona").item(0).text) ;

	}

function stronyInfo(id)
	{
		window.open('strony/index.php?id='+id,'okno','toolbar=no,menubar=no,scrollbar=no,resizable=no,heigh=600,width=800')
// window,"status: false;scroll: yes;dialogWidth:800px;dialogHeight: 700px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");		
		//showModalDialog('strony/index.php?id='+id, window,"status: false;scroll: yes;dialogWidth:800px;dialogHeight: 700px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");		
	/*	

		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async="false";
		xmlDoc.load('strony/view.php?id='+id);
		stronyDodaj();

		document.all['id'].value=id;
		document.all['wlasciciel'].value=xmlDoc.getElementsByTagName("wlasciciel").item(0).text;								
		document.all['tytul_strona'].value=xmlDoc.getElementsByTagName("tytul_strona").item(0).text;						
		document.all['nadrzedna_strona'].value=xmlDoc.getElementsByTagName("nadrzedna_strona").item(0).text;
		document.all['nazwa_nadrzedna_strona'].innerHTML=xmlDoc.getElementsByTagName("nazwa_nadrzedna_strona").item(0).text;		
		document.all['nazwa_mini_strona'].innerHTML=xmlDoc.getElementsByTagName("mini_strona").item(0).text;		
		document.all['zajawka_strona'].innerHTML=xmlDoc.getElementsByTagName("zajawka_strona").item(0).text;
		document.all['nazwa_strefa_strona'].innerHTML=xmlDoc.getElementsByTagName("strefa_strona").item(0).text;
*/
		
	}


function stronyDodaj()
	{
		showModalDialog('strony/index.php?id=0', window,"status: false;scroll: yes;dialogWidth:800px;dialogHeight: 700px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");		
		/*
		nawigacjaWstecz.push(new nawigacjaZrzut());		
		menuUstaw('strony');
		document.all['logo'].innerHTML='<div align="center"><img src="images/strony.gif" width="41" height="41"></div>';
		document.all['naglowek'].innerHTML='<b>Strony</b>';
		document.all['panel'].innerHTML='';
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
       	xmlDoc.async="false";
		xmlDoc.load('podmenu.php?menu=strony');
		outHTML ='<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">'
				+' <tr>'
				+'  <td width="140" background="images/tlobok.gif" valign="top">'
				+'   <table width="100%" border="0" cellspacing="1" cellpadding="0">'				
		i=0;
		while(i<xmlDoc.getElementsByTagName("nazwa_menu_podstrona").length)
			{
				outHTML+='<tr>'
						+'<td width="5"></td>'
						+'<td>'
						+'   <table width="120" height="18" border="0" cellspacing="1" cellpadding="1" id="slownik_'+xmlDoc.getElementsByTagName("nazwa_menu_podstrona").item(i).text+'" class="pointer" onClick="ustawPodStrona(\''+xmlDoc.getElementsByTagName("modul_menu_podstrona").item(i).text+'\',\''+xmlDoc.getElementsByTagName("nazwa_menu_podstrona").item(i).text+'\')" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
						+'    <tr>'
						+'     <td>'
						+'      <table width="100%" border="0" cellspacing="0" cellpadding="0">'
						+'       <tr>'
						+'        <td width="10"></td>'
						+'        <td>'+xmlDoc.getElementsByTagName("nazwa_menu_podstrona").item(i).text+'</td>'
						+'        <td width="10"></td>'						
						+'       </tr>'
						+'      </table>'
						+'     </td>'
						+'    </tr>'
						+'   </table>'						
						+' </td>'
						+'</tr>';
				i++;				
			}				
		outHTML+=' </table>'				
				
				+'  </td>'
				+'  <td valign="top">'
				+'  <br>'
				+'<div align="center">'
				+'<table width="98%" border="0" cellspacing="1" cellpadding="1" bgcolor="#DCE3EB">'
				+' <tr>'
				+'  <td height="16" bgcolor="#FFFFFF" background="images/tlonaglowek.gif">'
				
				+'    <table height="100%" border="0" cellspacing="1" cellpadding="1" class="pointer" align="right" onClick="dokumentUkryj()" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
				+'     <tr>'
				+'      <td>'
				+'      <table border="0" cellspacing="0" cellpadding="0">'
				+'       <tr>'
				+'        <td width="20" id="infoPrzycisk"><div align="center"><img src="images/arrowup.gif" width="13" height="13"></div></td>'
				+'       </tr>'
				+'      </table>'
				+'      </td>'
				+'     </tr>'
				+'    </table>'				
				
				
				+'  <table border="0" cellspacing="0" cellpadding="0">'
				+'   <tr>'
				+'    <td>'
				+'    <table border="0" cellspacing="1" cellpadding="1" class="pointer" onClick="stronyZapisz()" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
				+'     <tr>'
				+'      <td>'
				+'      <table border="0" cellspacing="0" cellpadding="0">'
				+'       <tr>'
				+'        <td width="5"></td>'						
				+'        <td width="20"><img src="images/save.gif" width="14" height="14"></td>'
				+'        <td>Zapisz</td>'
				+'        <td width="10"></td>'						
				+'       </tr>'
				+'      </table>'
				+'      </td>'
				+'     </tr>'
				+'    </table>'
				+'    </td>'
				+'    <td>|</td>'
				+'    <td>'
				+'    <table border="0" cellspacing="1" cellpadding="1" class="pointer" onClick="stronyUsun()" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
				+'     <tr>'
				+'      <td>'
				+'      <table border="0" cellspacing="0" cellpadding="0">'
				+'       <tr>'
				+'        <td width="5"></td>'						
				+'        <td width="20"><img src="images/delete.gif" width="14" height="14"></td>'
				+'        <td>Usuń</td>'
				+'        <td width="10"></td>'						
				+'       </tr>'
				+'      </table>'
				+'      </td>'
				+'     </tr>'
				+'    </table>'
				+'    </td>'
				+'    <td>'
				+'    <table border="0" cellspacing="1" cellpadding="1" class="pointer" id="nowy_element">'
				+'     <tr>'
				+'      <td>'
				+'      </td>'
				+'     </tr>'
				+'    </table>'
				+'    </td>'				
				+'    <td>|</td>'				
				+'    <td>'
				+'    <table border="0" cellspacing="1" cellpadding="1" class="pointer"  onClick="dokumentPowrot()" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
				+'     <tr>'
				+'      <td>'
				+'      <table border="0" cellspacing="0" cellpadding="0">'
				+'       <tr>'
				+'        <td width="5"></td>'
				+'        <td width="20"><img src="images/powrot.gif" width="14" height="14"></td>'
				+'        <td>Powrót</td>'
				+'        <td width="10"></td>'						
				+'       </tr>'
				+'      </table>'
				+'      </td>'
				+'     </tr>'
				+'    </table>'
				+'    </td>'				
								
				+'   </tr>'
				+'  </table>'
				+'  </td>'
				+' </tr>'
				+'</table>'
				+'<div id="info">'								
		        +'<table border="0" cellspacing="1" cellpadding="0">'
				+' <tr>';
		for(i=0;i<40;i++)
			{
				outHTML+='<td width="20">&nbsp;</td>';
			}
		outHTML+=' </tr>'
				+' <tr height="20">'
				+'  <td colspan="2"></td>'
				+'  <td colspan="6">Strona główna</td>'
				+'  <td colspan="10">'
				+'  <table width="195" border="0" cellspacing="1" cellpadding="1" bgcolor="#7F9DB9">'
				+'   <tr>'
				+'    <td bgcolor="#FFFFFF" id="focus_glowna_strona">'
				+'    <table border="0" cellspacing="1" cellpadding="0">'
				+'     <tr>'
				+'      <td width="183" id="nazwa_glowna_strona">&nbsp;</td>'
				+'      <td width="13" id="glowna_strona_b" onClick="slownikiPokaz(\'glowna_strona\',\'#FFFF00\')" onMouseOver="ustawPrzycisk(this,\'#D7E7FD\')" onMouseOut="ustawPrzycisk(this,\'\')"><img src="images/downarrow.gif" width="13" height="13" class="pointer"></td>'
				+'     </tr>'
				+'    </table>'
				+'    </td>'
				+'   </tr>'
				+'  </table>'				
				+'  </td>'
				+'  <td colspan="4"></td>'				
				+'  <td colspan="6">Strona podrzędna</td>'
				+'  <td colspan="10">'
				+'  <table width="195" border="0" cellspacing="1" cellpadding="1" bgcolor="#7F9DB9">'
				+'   <tr>'
				+'    <td bgcolor="#FFFFFF" id="focus_nadrzedna_strona">'
				+'    <table border="0" cellspacing="1" cellpadding="0">'
				+'     <tr>'
				+'      <td width="183" id="nazwa_nadrzedna_strona">&nbsp;</td>'
				+'      <td width="13" id="nadrzedna_strona_b" onClick="slownikiPokaz(\'nadrzedna_strona\',\'#FFFF00\')" onMouseOver="ustawPrzycisk(this,\'#D7E7FD\')" onMouseOut="ustawPrzycisk(this,\'\')"><img src="images/downarrow.gif" width="13" height="13" class="pointer"></td>'
				+'     </tr>'
				+'    </table>'
				+'    </td>'
				+'   </tr>'
				+'  </table>'				
				+'  </td>'				
				+' </tr>'				
				+' <tr height="4">'
				+'  <td colspan="40"></td>'
				+' </tr>'
				+' <tr height="20">'
				+'  <td colspan="2"></td>'
				+'  <td colspan="6">Rodzaj strony</td>'
				+'  <td colspan="10">'
				+'  <table width="195" border="0" cellspacing="1" cellpadding="1" bgcolor="#7F9DB9">'
				+'   <tr>'
				+'    <td bgcolor="#FFFFFF" id="focus_strefa_strona">'
				+'    <table border="0" cellspacing="1" cellpadding="0">'
				+'     <tr>'
				+'      <td width="183" id="nazwa_strefa_strona">modul</td>'
				+'      <td width="13" id="strefa_strona_b" onClick="stronyStrefaStronaPokaz(\'strefa_strona\',\'#FFFF00\')" onMouseOver="ustawPrzycisk(this,\'#D7E7FD\')" onMouseOut="ustawPrzycisk(this,\'\')"><img src="images/downarrow.gif" width="13" height="13" class="pointer"></td>'
				+'     </tr>'
				+'    </table>'
				+'    </td>'
				
				+'   </tr>'
				+'  </table>'				
				
				+'  </td>'				

				+' </tr>'
				+' <tr height="4">'
				+'  <td colspan="40"></td>'
				+' </tr>'				
				+' <tr height="20">'
				+'  <td colspan="2"></td>'
				+'  <td colspan="6">Tytuł</td>'
				+'  <td colspan="30"><input type="text" name="tytul_strona" size="120" class="input" onFocus="ustawFocus(this,\'#FFFF00\',\'#7F9DB9\')" onBlur="ustawFocus(this,\'\',\'#7F9DB9\')"></td>'				
				+' <tr height="20">'

				+' </tr>'				
				+' <tr height="4">'
				+'  <td colspan="40"></td>'
				+' </tr>'				
				+' <tr height="20">'
				+'  <td colspan="2"></td>'
				+'  <td colspan="6">Miniaturka</td>'
				+'  <td colspan="30">'
				+'  <table width="616" border="0" cellspacing="1" cellpadding="1" bgcolor="#7F9DB9">'
				+'   <tr>'
				+'    <td bgcolor="#FFFFFF" id="focus_mini_strona">'
				+'    <table border="0" cellspacing="1" cellpadding="0">'
				+'     <tr>'
				+'      <td width="603" id="nazwa_mini_strona">&nbsp;</td>'
				+'      <td width="13" id="mini_b" OnClick="stronyMiniPokaz()"  onMouseOver="ustawPrzycisk(this,\'#D7E7FD\')" onMouseOut="ustawPrzycisk(this,\'\')"><img src="images/dot.gif" width="13" height="13" class="pointer"></td>'
				+'     </tr>'
				+'    </table>'
				+'    </td>'
				+'   </tr>'
				+'  </table>'				
				+'  </td>'
				+' </tr>'					
				+' <tr height="60">'
				+'  <td colspan="2"></td>'
				+'  <td colspan="6" valign="top">Zajawka</td>'
				+'  <td colspan="30"><textarea name="zajawka_strona" type="text" rows="6" cols="122" class="vpole" onFocus="ustawFocus(this,\'#FFFF00\',\'#7F9DB9\')" onBlur="ustawFocus(this,\'\',\'#7F9DB9\')"></textarea></td>'
				+' </tr>'				
				+' <tr height="4">'
				+'  <td colspan="40"></td>'
				+' </tr>'				
				+' <tr height="4">'
				+'  <td colspan="8">'				
				+'  <td colspan="30" id="edytorek"><br><br>'

			
var oFCKeditor = new FCKeditor('editor') ;
oFCKeditor.BasePath = '/kseromax/fckeditor/' ;
oFCKeditor.ImageBrowserURL = '/kseromax/fckeditor/editor/filemanager/browser/default/browser.php' 
oFCKeditor.Width	= '98%' ;
oFCKeditor.Height	= 400 ;
	
HTML=oFCKeditor.Create();

outHTML+=HTML;
//document.all['naglowek'].innerText=HTML;
		outHTML+='<table width="98%" border="0" cellspacing="1" cellpadding="0">'
				+' <tr>'
				+'  <td id="podstrona"></td>'
				+' </tr>'
				+'</table>'
				+'<input name="id" type="hidden" value="-1">'
				+'<input name="wlasciciel" type="hidden" value="0">'
				+'<input name="strefa_strona" type="hidden" value="modul">'
				+'<input name="glowna_strona" type="hidden" value="0">'		
				+'<input name="nadrzedna_strona" type="hidden" value="0">'						
											
		document.all['strona'].innerHTML=outHTML;	
*/		
	}

//*****************************************************************************
//  PODFUNKCJE
//*****************************************************************************



//*****************************************************************************
//  AKCJE
//*****************************************************************************




	
var init_text_color = null;
var init_page_color = null;
var filesDialog='files.php';

 DECMD_BOLD =                      5000;
 DECMD_COPY =                      5002;
 DECMD_CUT =                       5003;
 DECMD_DELETE =                    5004;
 DECMD_DELETECELLS =               5005;
 DECMD_DELETECOLS =                5006;
 DECMD_DELETEROWS =                5007;
 DECMD_FINDTEXT =                  5008;
 DECMD_FONT =                      5009;
 DECMD_GETBACKCOLOR =              5010;
 DECMD_GETBLOCKFMT =               5011;
 DECMD_GETBLOCKFMTNAMES =          5012;
 DECMD_GETFONTNAME =               5013;
 DECMD_GETFONTSIZE =               5014;
 DECMD_GETFORECOLOR =              5015;
 DECMD_HYPERLINK =                 5016;
 DECMD_IMAGE =                     5017;
 DECMD_INDENT =                    5018;
 DECMD_INSERTCELL =                5019;
 DECMD_INSERTCOL =                 5020;
 DECMD_INSERTROW =                 5021;
 DECMD_INSERTTABLE =               5022;
 DECMD_ITALIC =                    5023;
 DECMD_JUSTIFYCENTER =             5024;
 DECMD_JUSTIFYLEFT =               5025;
 DECMD_JUSTIFYRIGHT =              5026;
 DECMD_LOCK_ELEMENT =              5027;
 DECMD_MAKE_ABSOLUTE =             5028;
 DECMD_MERGECELLS =                5029;
 DECMD_ORDERLIST =                 5030;
 DECMD_OUTDENT =                   5031;
 DECMD_PASTE =                     5032;
 DECMD_REDO =                      5033;
 DECMD_REMOVEFORMAT =              5034;
 DECMD_SELECTALL =                 5035;
 DECMD_SEND_BACKWARD =             5036;
 DECMD_BRING_FORWARD =             5037;
 DECMD_SEND_BELOW_TEXT =           5038;
 DECMD_BRING_ABOVE_TEXT =          5039;
 DECMD_SEND_TO_BACK =              5040;
 DECMD_BRING_TO_FRONT =            5041;
 DECMD_SETBACKCOLOR =              5042;
 DECMD_SETBLOCKFMT =               5043;
 DECMD_SETFONTNAME =               5044;
 DECMD_SETFONTSIZE =               5045;
 DECMD_SETFORECOLOR =              5046;
 DECMD_SPLITCELL =                 5047;
 DECMD_UNDERLINE =                 5048;
 DECMD_UNDO =                      5049;
 DECMD_UNLINK =                    5050;
 DECMD_UNORDERLIST =               5051;
 DECMD_PROPERTIES =                5052;

 OLECMDEXECOPT_DODEFAULT =         0;
 OLECMDEXECOPT_PROMPTUSER =        1;
 OLECMDEXECOPT_DONTPROMPTUSER =    2;


function setTools(tools,color,border)
	{
		tools.style.backgroundColor=color;
		tools.style.borderColor=border;		
	}
	
function vTableInsert(nr,nc,at,ac,tit) 
	{
		document.all['editor'].focus();
 		var pVar = document.table_info;
 		pVar.NumRows = 2;//nr;
 		pVar.NumCols = 2; //nc;
 		pVar.TableAttrs ='width="100%" cellpadding="1" cellspacing="1" bgcolor="#0066CC"';
 		pVar.CellAttrs ='bgcolor="#FFFFFF" width="50%"';
		// 	pVar.CellAttrs ='style=BORDER-LEFT-COLOR: #000000';
		document.all['editor'].ExecCommand(DECMD_INSERTTABLE,OLECMDEXECOPT_DODEFAULT, pVar);
 		return true;
	}
function vTableInsertRow() 
	{
		document.all['editor'].focus();
		document.all['editor'].ExecCommand(DECMD_INSERTROW,OLECMDEXECOPT_DODEFAULT);
	}

function vTableDeleteRow() 
	{
		document.all['editor'].focus();
		document.all['editor'].ExecCommand(DECMD_DELETEROWS,OLECMDEXECOPT_DODEFAULT);
	}

function vTableInsertCol() 
	{
		document.all['editor'].focus();
		document.all['editor'].ExecCommand(DECMD_INSERTCOL,OLECMDEXECOPT_DODEFAULT);
	}

function vTableDeleteCol() 
	{
		document.all['editor'].focus();
		document.all['editor'].ExecCommand(DECMD_DELETECOLS,OLECMDEXECOPT_DODEFAULT);
	}

function vTableInsertCell() 
	{
		document.all['editor'].focus();
		document.all['editor'].ExecCommand(DECMD_INSERTCELL,OLECMDEXECOPT_DODEFAULT);
	}

function vTableDeleteCell() 
	{
		document.all['editor'].focus();
		document.all['editor'].ExecCommand(DECMD_DELETECELLS,OLECMDEXECOPT_DODEFAULT);
	}



function vTextBold(){
	document.all['editor'].focus();
 	document.all['editor'].ExecCommand(DECMD_BOLD,OLECMDEXECOPT_DODEFAULT);
}
function vTextItalic(){
	document.all['editor'].focus();
 	document.all['editor'].ExecCommand(DECMD_ITALIC,OLECMDEXECOPT_DODEFAULT);
}
function vTextUnderline(){
	document.all['editor'].focus();
 	document.all['editor'].ExecCommand(DECMD_UNDERLINE,OLECMDEXECOPT_DODEFAULT);
}

function vTextLeft()
	{
		document.all['editor'].focus();
 		document.all['editor'].ExecCommand(DECMD_JUSTIFYLEFT,OLECMDEXECOPT_DODEFAULT);
	}

function vTextCenter()
	{
		document.all['editor'].focus();
 		document.all['editor'].ExecCommand(DECMD_JUSTIFYCENTER,OLECMDEXECOPT_DODEFAULT);
	}

function vTextRight()
	{
		document.all['editor'].focus();
 		document.all['editor'].ExecCommand(DECMD_JUSTIFYRIGHT,OLECMDEXECOPT_DODEFAULT);
	}

function vtnList()
	{
		document.all['editor'].focus();
 		document.all['editor'].ExecCommand(DECMD_ORDERLIST,OLECMDEXECOPT_DODEFAULT);
	}

function vtList() 
	{
		document.all['editor'].focus();
 		document.all['editor'].ExecCommand(DECMD_UNORDERLIST,OLECMDEXECOPT_DODEFAULT);
	}

function vtMin() {
	document.all['editor'].focus();
 	document.all['editor'].ExecCommand(DECMD_OUTDENT,OLECMDEXECOPT_DODEFAULT);
}
function vtMax() {
	document.all['editor'].focus();
 	document.all['editor'].ExecCommand(DECMD_INDENT,OLECMDEXECOPT_DODEFAULT);
}

function vLink()
	{
		document.all['editor'].focus();
 		document.all['editor'].ExecCommand(DECMD_HYPERLINK,OLECMDEXECOPT_PROMPTUSER);
	}

function vUnlink()
	{
		document.all['editor'].focus();
 		document.all['editor'].ExecCommand(DECMD_UNLINK,OLECMDEXECOPT_PROMPTUSER);
	}

function vTextColor() 
	{
		document.all['editor'].focus();
		if(init_text_color == null) 
			{
				var rgbcolor = document.all['helper'].ChooseColorDlg();
			} 
		else 
			{
				var rgbcolor = document.all['helper'].ChooseColorDlg(init_text_color);
			}
		rgbcolor = rgbcolor.toString(16);
		if(rgbcolor.length < 6) 
			{
  				var sTempString = "000000".substring(0,6-rgbcolor.length);
  				rgbcolor = sTempString.concat(rgbcolor);
			}
		init_text_color = rgbcolor;
		document.all['editor'].ExecCommand(DECMD_SETFORECOLOR,OLECMDEXECOPT_DODEFAULT,  rgbcolor);
}

function vPageColor() {
	document.all['editor'].focus();
	if(init_page_color == null) {
		var rgbcolor = document.all['helper'].ChooseColorDlg();
	} else {
		var rgbcolor = document.all['helper'].ChooseColorDlg(init_page_color);
	}
	rgbcolor = rgbcolor.toString(16);
	if(rgbcolor.length < 6) {
  		var sTempString = "000000".substring(0,6-rgbcolor.length);
  		rgbcolor = sTempString.concat(rgbcolor);
	}
	init_page_color = rgbcolor;
	document.all['editor'].ExecCommand(DECMD_SETBACKCOLOR,OLECMDEXECOPT_DODEFAULT,  rgbcolor);
}

function insertfile(filetext) {
	insertText(filetext,'',true,true);
}

function insertText(sStart, sEnd, asHTML, bAllowEmpty) {
		document.all['editor'].focus();
	var oSelection = window.document.all["editor"].DOM.selection;
	if (!bAllowEmpty && oSelection.type == "None") return;
	oTR = oSelection.createRange();
	if (oSelection.type == "Control") {
	    var elHTML = oTR.item(0).outerHTML;
	    oTR.item(0).outerHTML = sStart + elHTML + sEnd;
	} else {
		if(asHTML) {
    		if(oSelection.type == "None") {
        		oTR.pasteHTML(sStart + sEnd);
        } else {
        	oTR.pasteHTML(sStart + oTR.htmlText + sEnd);
        }
    } else {
    	oTR.text = sStart + oTR.text + sEnd;
    }
  }
  oTR.collapse();
  oTR.select();
}

function vPageFoto()
	{
		showModalDialog('foto/index.php', window,"status: false;scroll: yes;dialogWidth: 600px; dialogHeight: 450px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");		
	}


function stronyMiniPokaz()
	{
				showModalDialog('../foto/mini.php', window,"status: false;scroll: yes;dialogWidth: 600px; dialogHeight: 450px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");
	}
	
function stronyStrefaStronaPokaz(slownik,kolorTlo)
	{
		dokumentOnClick=4;
		dokumentSlownik=slownik;
		szerokosc=196;
		eval('on_menu = document.getElementById("'+slownik+'_b")');
		document.all["focus\_"+slownik].style.backgroundColor=kolorTlo;
		document.all["menu"].style.left = get_real_left(on_menu)-180;
		document.all["menu"].style.top = get_real_top(on_menu)+15;
		document.all["menu"].style.visibility = "visible";
		outHTML='<table width="'+szerokosc+'" border="0" cellspacing="1" cellpadding="0" bgcolor="#7F9DB9">'
				 +'<tr>'
				 +'<td valign="top" bgcolor="#FAFAFA">'
				 +'<table width="100%" border="0" cellspacing="1" cellpadding="0">'
				// +'<tr><td class="pointer" id="slownik_0" onClick="slownikUstaw(\''+slownik+'\',0)">start</td><tr>'
				 +'<tr><td class="pointer" id="slownik_1" onClick="slownikUstaw(\''+slownik+'\',1)">index</td><tr>'		
				 +'<tr><td class="pointer" id="slownik_2" onClick="slownikUstaw(\''+slownik+'\',2)">info</td><tr>'
				 +'<tr><td class="pointer" id="slownik_3" onClick="slownikUstaw(\''+slownik+'\',3)">modul</td><tr>'
				// +'<tr><td class="pointer" id="slownik_4" onClick="slownikUstaw(\''+slownik+'\',4)">pozycje</td><tr>'						 
				 +'</table>'
				 +'</td>'
				 +'</tr>'
				+'</table>';

		document.all["menu"].innerHTML=outHTML;
	}	
