	var tips=new Array();
	var tipTitles=new Array();
	tips[0]="<font face='Arial, Helvetica' size='-1'>Normally hyperlinks in JEditorPane with HTMLEditorKit are processed only when the JEditorPane isn't editable. Thus to let user click on such links or show hand cursor over them programmer must call setEditable(false) method.  The solution is based on replacing HTMLEditorKit's original LinkHandler with a custom one."+ 
	"<br><a href='tip_links_in_editable.html' style='text-decoration: none;'>Read more to see how to overcome the editable state of JEditorPane&gt;</a></font>";
	tipTitles[0]="<strong>Processing hyperlinks in editable JEditorPane with HTMLEditorKit.</strong>";
	
	tips[1]="<font face='Arial, Helvetica' size='-1'>There are two types of paragraph's first line indent: normal and hanging. Normal is easy achieved by specifying some positive value in appropriate attribute. For the hanging indent we have to specify not only some negative value but additionally equal positive left indent. When we do this in ParagraphView of StyledEditorKit we see some problems with select all and painting the par of first line in newly inserted paragraph. That could be fixed by changing ParagraphView behavior."+ 
	"<br><a href='tip_hanging_first_line.html' style='text-decoration: none;'>Read more to see how hanging first line works in customized paragraph&gt;</a></font>";
	tipTitles[1]="<strong>Hanging (Negative) first line indent in JEditorPane.</strong>";
	
	tips[2]="<font face='Arial, Helvetica' size='-1'>By default java uses 72 pixels TabStop size which equals to 1 inch on paper. Sometimes it's necessary to change the default size but it's hardcoded in Paragraph. To change the size we have to change behaviour of nextTabStop() method."+ 
	"<br><a href='tip_default_tabstop_size.html' style='text-decoration: none;'>Read more to see how to customize default TabStop size&gt;</a></font>";
	tipTitles[2]="<strong>Default TabStop size customization in JEditorPane.</strong>";
	
	tips[3]="<font face='Arial, Helvetica' size='-1'>A good practice in editors is to create links automatically as soon as user typed it (e.g. some text started from 'www' or 'http' ). "+
	"<br><a href='tip_autocreate_links.html' style='text-decoration: none;'>Read more to see how to add the auto conversion feature &gt;</a></font>";
	tipTitles[3]="<strong>Autocreation links from user typed text in JEditorPane with HTMLEditorKit.</strong>";
	
	tips[4]="<font face='Arial, Helvetica' size='-1'>By default elementary undoable edits are created for each Document's structure change e.g. for each typed letter. Undoing them one by one isn't very comfortable for user. It's much better if we group them somehow in bigger merged compound undoable edits and Undo them by groups. "+
	"<br><a href='tip_merge_undo_edits.html' style='text-decoration: none;'>Read more to see how to merge the UndobleEdits in groups &gt;</a></font>";
	tipTitles[4]="<strong>Merging elementaty UndoableEdits in one in JEditorPane.</strong>";
	
	tips[5]="<font face='Arial, Helvetica' size='-1'>Implementing chat or messenger application we often need something like this. That's a small funny feature based on DocumentListener and StyledEditorKit to support images. "+
	"<br><a href='tip_autoreplace_smiles.html' style='text-decoration: none;'>Read more to see the example of autoreplacing typed text with images &gt;</a></font>";
	tipTitles[5]="<strong>Autoreplace smiles text e.g :) with appropriate images in JEditorPane.</strong>";
	
	tips[6]="<font face='Arial, Helvetica' size='-1'>Normally the <b>overwrite</b> mode is used in editors to replace existing text during typing. When when the mode is ON newly typed text replaces previous text. It has visible for user effect showed as rectangle caret shape."+
"<br><a href='tip_overwrite_mode.html' style='text-decoration: none;'>Read more to see the example application of modes switching by INSERT key&gt;</a></font>";
	tipTitles[6]="<strong>Overwrite/Insert modes switching by INSERT key in JEditorPane.</strong>";
	
	tips[7]="<font face='Arial, Helvetica' size='-1'>The code can be useful when we need to merge to DefaultStyledDocument with all structures and attributes e.g. when single message must be added in a list"+
	"<br><a href='tip_merge_documents.html' style='text-decoration: none;'>Read more to see the merge method and example application to see how it works&gt;</a></font>";
	tipTitles[7]="<strong>Merge two Documents' content in one.</strong>";
	
	tips[8]="<font face='Arial, Helvetica' size='-1'>To select vertical block of text typed in JTextArea it's necessary to create multiple selection fragments of the text. That can be achieved from custom caret."+ 
"<br><a href='tip_vertical_selection.html' style='text-decoration: none;'>Read more to see the example class for the caret&gt;</a></font>";
	tipTitles[8]="<strong>Vertical text fragment highlight in JTextArea.</strong>";
	
	tips[9]="<font face='Arial, Helvetica' size='-1'>Dynamic images in a HTML opened in JEditorPane can be used to show something without real access to disk or internet. Instead the images can be stored in e.g. a .jar file or created on fly. To let JEditorPane access them we can put them in cache used by HTMLEditorKit."+ 
"<br><a href='tip_local_images.html' style='text-decoration: none;'>Read more to see how to put them in the cache&gt;</a></font>";
	tipTitles[9]="<strong>Local images loading for HTML opened in JEditorPane.</strong>";
	
	tips[10]="<font face='Arial, Helvetica' size='-1'>Sometimes it's necessary to get view bounds e.g. to highlight it in parent component or to paint part of visible content. The following method returns the view bounds rectangle."+ 
"<br><a href='tip_view_rectangle.html' style='text-decoration: none;'>Read more to see the method code&gt;</a></font>";
	tipTitles[10]="<strong>Obtaining View's rectangle in  JEditorPane.</strong>";
	
	tips[11]="<font face='Arial, Helvetica' size='-1'>When a font isn't installed in OS but used from a file or as a resource from .jar library JEditorPane can't get it because font obtaining is based on list of fonts accessible from <strong>Toolkit.getFontList()</strong>. To provide access to such a font we can override <strong>getFont()</strong> method of <strong>Document</strong> used in the JEditorPane."+
	"<br><a href='tip_custom_font.html' style='text-decoration: none;'>Read more about custom font access in Document&gt;</a></font>";
	tipTitles[11]="<strong>Using custom font (not registered) in StyledDocument of JEditorPane.</strong>";
	
	tips[12]="<font face='Arial, Helvetica' size='-1'>To calculate row and column numbers for current caret position in any of JEditorPane, JTextPane and JTextArea we can use <strong>javax.swing.text.Utilities</strong> class."+
"<br><a href='tip_row_column.html' style='text-decoration: none;'>Read more to see getRow() and getColumn() functions  &gt;</a></font>";
	tipTitles[12]="<strong>Row and column of caret in JTextComponent.</strong>";
	
	tips[13]="<font face='Arial, Helvetica' size='-1'>To provide vertical alignment of JEditorPane's content root view must be replaced with a new one where children offsets recalculated properly."+
"<br><a href='tip_center_vertically.html' style='text-decoration: none;'>Read more to see the working example &gt;</a></font>";
	tipTitles[13]="<strong>Centering text vertically in JEditorPane.</strong>";
	
	tips[14]="<font face='Arial, Helvetica' size='-1'>Sometimes formatted content of JEditorPane or JTextPane should fill available width. The text is wrapped in several lines. To measure the necessary height we can use dummy component."+
"<br><a href='tip_text_height_measuring.html' style='text-decoration: none;'>Read more to find how to get the height of the content &gt;</a></font>";
	tipTitles[14]="<strong>JEditorPane's content height for fixed width.</strong>";
	
	tips[15]="<font face='Arial, Helvetica' size='-1'>When paragraph's alignment isn't left (e.g. right or center) tab char is represented as fixed width space rather than normal insets. The behavior is provided by <strong>javax.swing.text.ParagraphView</strong> class in the method<br>"+
"<font color='navy'><b>public</b></font> <font color='navy'><b>float</b></font> nextTabStop(<font color='navy'><b>float</b></font> x, <font color='navy'><b>int</b></font> tabOffset)"+
"<br><a href='tip_tab_in_aligned_par.html' style='text-decoration: none;'>Read more to find how to change the behavior &gt;</a></font>";
	tipTitles[15]="<strong>Tab char measuring in paragraph with right or center alignment.</strong>";
	
	tips[16]="<font face='Arial, Helvetica' size='-1'>Custom operations with Document structure or Document's elements attributes need to be reflected in Views. For such cases the following refresh() method was written. The refresh method generates a dummy event to notify document listeners about structure changes in given position and offset. "+
	"<br><a href='tip_refresh_view.html' style='text-decoration: none;'>Read more about refresh of JEditorPane's view&gt;</a></font>";
	tipTitles[16]="<strong>Refresh Views to show document's changes in JEditorPane.</strong>";
	
	tips[17]="<font face='Arial, Helvetica' size='-1'>HTML in browsers provide space based wrap support. Alternatively in custom layout we may need a letter based wrap behaviour. In other words content should be wrapped in the mid of word not by space. "+
	"<br><a href='tip_html_letter_wrap.html' style='text-decoration: none;'>Read more about letter wrap for html in JEditorPane&gt;</a></font>";
	tipTitles[17]="<strong>Letter wrap in html in JEditorPane.</strong>";
	
	tips[18]="<font face='Arial, Helvetica' size='-1'>JTextPane with HTMLEditorKit set ignores/removes empty last empty paragraphs when we try to get html content via getText() method. The behavior comes from the<em> protected boolean inRange(Element next)</em> method of the HTMLWriter. <a href='tip_html_kit_last_empty_par.html' style=' text-decoration: none;'>Read more about loosing last paragraph in JEditorPane fix&gt;</a></font>";
	tipTitles[18]="<strong>Loosing last empty paragraph in HTML from JEditorPane fix.</strong>";
	
	tips[19]="<font face='Arial, Helvetica' size='-1'>To implement coloring of strikethrough attribute we define a custom attribute with name \"strike-color\" in the StyledEditorKit extension. The attributes value is necessary Color. <a href='tip_colored_strikethrough.html' style='text-decoration: none;'>Read more about coloring strikethrough in JEditorPane&gt;</a></font>	";
	tipTitles[19]="<strong>Colored Strikethrough text attribute with user defined color in JEditorPane.</strong>";
	
	tips[20]="<font face='Arial, Helvetica' size='-1'>If we want to use JEditorPane as a limited browser we often need to submit form sending the form's data to server and obtain results. <a href='tip_submit_form_post.html' style=' text-decoration: none;'>Read more about submitting form in JEditorPane&gt;</a></font>";
	tipTitles[20]="<strong>Form submitting (method=POST) in JEditorPane with HTMLEditorKit.</strong>";
	
	tips[21]="<font face='Arial, Helvetica' size='-1'>If a Container with CardLayout contains multiple components and we want to add a bit more dynamic. To show next or previous component we move the old component out and replace it with a new one. <a href='tip_slider.html' style='text-decoration: none;'>Read more about sliding component&gt;</a></font>";
	tipTitles[21]="<strong>Slider to rotate content of Container.</strong>";
	
	tips[22]="<font face='Arial, Helvetica' size='-1'>A useful GUI element is a JLabel which resizes its font to fill all available space. On each resize we just check possible bounds of the lable's text to fit available area. <a href='tip_adapt_label_font_size.html' style=' text-decoration: none;'>Read more about the JLabel extension&gt;</a></font>	";
	tipTitles[22]="<strong>Changing JLabel's font size to fill all available space.</strong>";
	
	tips[23]="<font face='Arial, Helvetica' size='-1'>By default java allows only one floatable JToolBar for JFrame and it floats only if BorderLayout is set. The solution provides BorderLayout extension to let user add multiple components to all sides. <a href='tip_multiple_floatable_toolbars.html' style=' text-decoration: none;'>Read more about the multiple floatable toolbars solution&gt;</a></font>	";
	tipTitles[23]="<strong>Multiple floatable JToolBars for JFrame.</strong>";
	
	var tipIndex=Math.floor(Math.random()*(tips.length));
	var tipTimeSec=15;
	var timer;
	
	function returnObjById( id ) {
		if (document.getElementById)
			var returnVar = document.getElementById(id);
		else if (document.all)
			var returnVar = document.all[id];
		else if (document.layers)
			var returnVar = document.layers[id];
		return returnVar;
	}
	
	function showTip(index) {
		returnObjById("tipTitle").innerHTML=tipTitles[index];
		returnObjById("tip").innerHTML=tips[index];
		returnObjById("tipNumber").innerHTML="<a href='' onClick='prev(); return false;' style='text-decoration: none;'>&lt;</a>"+
	"<font style='color: #00CCFF' size='+1'>Tip "+(index+1)+" of "+tips.length+"</font>"+
	"<a href='' onClick='next(); return false;' style='text-decoration: none;'>&gt;</a>";
	}
	
	function swapTip() {
		if (tipIndex>=tips.length) {
			tipIndex=0;
		}
		else if (tipIndex<0) {
			tipIndex=tips.length-1;
		}
		showTip(tipIndex);
		tipIndex++;
		timer=setTimeout("swapTip()",tipTimeSec*1000);
	}
    function cancelTip() {
        clearTimeout(timer);
    }
	function next() {
		cancelTip();
		swapTip();
	}
	function prev() {
		cancelTip();
		tipIndex-=2;
		swapTip();
	}
    function start() {
        returnObjById("tipRotator").innerHTML="<div id='tipNumber' style='margin-top:39;width:200; border-top: black 1px outset; border-bottom: black 1px outset' align='center'>"+
	"<a href='prev' onClick='prev(); return false;' style='text-decoration: none;'>&lt;</a>"+
	"<font style='color: #00CCFF' size='+1'>Tip 0 of 16</font>"+
	"<a href='next' onClick='next(); return false;' style='text-decoration: none;'>&gt;</a>"+
	"</div>"+
	"<div id='tipTitle' style='width:200; border-bottom: black 1px outset'>"+
	"[Tip title]	</div>"+
	"<div id='tip' style='width:200; border-bottom: black 1px outset' align='justify'>"+
	"[Tip body]<br>"+
	"Scripts running should be allowed to see tips here."+
	"</div>";
	swapTip();
    }

