var newwindow='';

function pickerPopup202(ifn,sam){
	var bl=screen.width/2-102;
	var bt=screen.height/2-104;
	var page="/includes/fcp202.html"+"?ifn="+escape(ifn)+"&sam="+escape(sam);
	if(!newwindow.closed&&newwindow.location){newwindow.location.href=page;
	}else{
		newwindow=window.open(page,"CTRLWINDOW","help=no,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,dependent=yes,width=250,height=250,left="+bl+",top="+bt+",");
		if(!newwindow.opener)newwindow.opener=self;};if(window.focus){newwindow.focus()
		}
	}
													var tips = new Array();
						var tags = new Array();
						tips[0] = 'Bold text: [b]text[/b]';
						tips[1] = 'Italic text: [i]text[/i]';
						tips[2] = 'Insert Link: [url=http://url]URL text[/url]';
						tips[3] = 'Insert Image: [img width=500 height=200]http://image_url[/img]';
						tips[4] = 'Display Code: [code]code[/code]';
						tips[5] = 'Flash Clip: [flash width=* height=*]http://flash_url[/flash]';
						tips[6] = 'Colored Text: <b>[color=#CCCCCC]text[/color]</b> <br /> If you dont know any color codes use the color chart below to find <br />out some color codes just replace the current color code "#CCCCCC".';
						tips[7] = 'Font Size: [size=15px]text[/size]';
						tips[8] = 'Start New Page: [page /]';
						tips[9] = 'This is for Quicktime .mov [mov]URL of film[/mov]';
						tips[10] = 'For Utube Videos [utube]You tube URL[/utube]';
						tags[0] = '[b]';
						tags[1] = '[/b]';
						tags[2] = false;
						tags[3] = '[i]';
						tags[4] = '[/i]';
						tags[5] = false;
						tags[6] = '[url=]';
						tags[7] = '[/url]';
						tags[8] = false;
						tags[9] = '[img width=500 height=200]';
						tags[10] = '[/img]';
						tags[11] = false;
						tags[15] = '[code]';
						tags[16] = '[/code]';
						tags[17] = false;
						tags[18] = '[flash width= height=]';
						tags[19] = '[/flash]';
						tags[20] = false;
						tags[21] = '[color=#CCCCCC]';
						tags[22] = '[/color]';
						tags[23] = false;
						tags[24] = '[size=]';
						tags[25] = '[/size]';
						tags[26] = false;
						tags[27] = '[page /]';
						tags[28] = '[mov]';
						tags[29] = '[/mov]';
						tags[30] = '[utube]';
						tags[31] = '[/utube]';
							tags[32] = false;
						
						var formNAMES = ".$formNames.";
						
						var agt = navigator.userAgent.toLowerCase();
						var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
						function show_tooltips(num) {
							document.getElementById('tooltips').innerHTML = tips[num];	
						}

							
							function OnTagButtonClick(number) {
								if(number == 27) {
									AddTag(tags[27]);
									return;
								}
								var closetag = number + 1;
								var current_state = number + 2;
								if(!is_ie) {
									if (document.form.field.selectionEnd && (document.form.field.selectionEnd - document.form.field.selectionStart > 0)) {
										Wrap(tags[number], tags[closetag]);
										return;
									}
								}
								
								if(tags[current_state] == false) {
									AddTag(tags[number]);
									tags[current_state] = true;
								}else{
									AddTag(tags[closetag]);
									tags[current_state] = false;
									
								}
							}
							function AddTag(tag) {
	
								 document.form.field.value += tag;
							}
							function Wrap(lft, rgt) {
								if (document.all) {
									strSelection = document.selection.createRange().text;
									if (strSelection!="") {
									document.selection.createRange().text = lft + strSelection + rgt;
									}
								}
								else if (document.getElementById) {
									var selLength = document.form.field.textLength;
									var selStart = document.form.field.selectionStart;
									var selEnd = document.form.field.selectionEnd;
									if (selEnd==1 || selEnd==2) selEnd=selLength;
									var s1 = (document.form.field.value).substring(0,selStart);
									var s2 = (document.form.field.value).substring(selStart, selEnd)
									var s3 = (document.form.field.value).substring(selEnd, selLength);
									document.form.field.value = s1 + lft + s2 + rgt + s3;
								}
							}