// JavaScript Document

function initEditor (strTextAreaName) {
 
 tinyMCE.init({
	  mode: "exact",
	  language: "en",
	  elements: strTextAreaName,
	  plugins: "table,advimage,advlink,flash",
	  theme: "advanced",
	  theme_advanced_toolbar_location: "top",
	  theme_advanced_toolbar_align: "left",
	  theme_advanced_path_location: "bottom",
	  theme_advanced_buttons1: "justifyleft,justifycenter,justifyright,justifyfull,separator,bold,italic,strikethrough,separator,sub,sup,separator,charmap",
	  theme_advanced_buttons2: "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,image,flash,separator,cleanup,removeformat,separator,code",
	  theme_advanced_buttons3: "tablecontrols",
	  extended_valid_elements: "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]",
	  relative_urls: false,
	  debug: false,
	  theme:"advanced",language:"en",file_browser_callback:"myFileBrowser",plugins:"safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",theme_advanced_buttons1:"save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",theme_advanced_buttons2:"cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime",theme_advanced_buttons3:"tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl",theme_advanced_buttons4:"styleprops,|,forecolor,backcolor,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,|,fullscreen,preview",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",content_css:"/example_data/example_full.css",plugin_insertdate_dateFormat:"%Y-%m-%d",plugin_insertdate_timeFormat:"%H:%M:%S",external_link_list_url:"example_data/example_link_list.js",external_image_list_url:"example_data/example_image_list.js",flash_external_list_url:"example_data/example_flash_list.js",template_external_list_url:"example_data/example_template_list.js",theme_advanced_resize_horizontal:false,theme_advanced_resizing:false,apply_source_formatting:true,spellchecker_languages:"+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv,Width=auto,Height:auto"
 });
}

function ShowHide (objHTML, objLink, strMore, strLess) {
 
 if (objHTML.style.display == 'none') {
  objHTML.style.display = '';
	objLink.innerHTML = strMore;
 } else {
  objHTML.style.display = 'none';
	objLink.innerHTML = strLess;
 }
 
}

function loadNewWindow(pagename) {
window.open(pagename,'_blank','width=740,height=500,top=0,left=20,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no');
}

function HideOthers (ObjNum) {
 
 var ObjName = 'item' + ObjNum + 'box';
 var OneObj;
 var OneObjName;
 
 for (Cnt = 1; Cnt <= 10; Cnt++) {
  
  OneObjName = 'item' + Cnt + 'box';
  
  OneObj = document.getElementById(OneObjName);
  
  if ((Cnt <= MaxBox) && (OneObj.className == 'box')) {
   if (OneObjName != ObjName) {
    OneObj.style.display = 'none';
   } else {
    OneObj.style.display = '';
   }
  }
  
 }
 
}

function showbox (ObjStr) {
 
 var OneObj;
 
 OneObj = document.getElementById(ObjStr);
 
 OneObj.style.display = '';
 
}

function hidebox (ObjStr) {
 
 var ObjName = ObjStr;
 var OneObj;
 
 OneObj = document.getElementById(ObjName);
 
 OneObj.style.display = 'none';
 
}

function clickMultiEdit (objCB, strValName) {
	 
	 var objHidden = document.getElementById (strValName);
	 
	 if (objCB.checked) {
		 if (objHidden.value != '') {
		   objHidden.value += ',';
		 }
		 objHidden.value += objCB.value;
	 } else {
		 var objVal = new String (objHidden.value);
		 objVal.replace (objCB.value, '');
		 objHidden.value = objCB.value;
	 }
	 
}