<!-- 
   var editFormat = "HTML";  
   var strIFrame;	
   function swapEditMode(strFrameName,strFieldName) {
      if (editFormat=="HTML") {
         textEdit.document.body.innerText = textEdit.document.body.innerHTML;
         textEdit.document.body.style.fontFamily = "monospace";
         textEdit.document.body.style.fontSize = "10pt";
         format="Text";
      }
      else {
         textEdit.document.body.innerHTML = textEdit.document.body.innerText;
         textEdit.document.body.style.fontFamily = "";
         textEdit.document.body.style.fontSize ="";
         format="HTML";
      }
      textEdit.focus();
      var s = textEdit.document.body.createTextRange();
      s.collapse(false);
      s.select();
   }
   function SwapImage(thisname,status)
     {
        if (thisname != null) {
           var ImageSource = "/assets/" + thisname + "-" + status + ".gif";
        }
        var objField = "document.cart." + thisname;
        objField = eval("document.cart." + thisname);
        objField.src = ImageSource;
     }
   function DeleteItem()
	{
	  document.forms.main.Mode.value = 3;
	  document.forms.main.submit();
	}

   function GetCalendar(strFieldName) 
   {
      var objField = eval("document.main." + strFieldName);
      var datInitialDate = objField.value;
      if (datInitialDate == null || datInitialDate == "") {
         strDate = new Date();
         var dd = strDate.getDay();
         var mm = strDate.getMonth()+1;
         var yy = strDate.getFullYear();
         datInitialDate = mm + "-" + dd + "-" + yy;   
      }
      datInitialDate = datInitialDate.replace(/\//g,'-'); 
      var datReturnDate = showModalDialog("/pop_ups/get_calendar.asp",datInitialDate,"status:false; dialogWidth:210px; dialogHeight:225px,screenY=400,top=400,left=400");
      objField.value = datReturnDate;
      objField = eval("document.all." + strFieldName);
      objField.focus();
   }
   function GetColor(strFieldName,strPage)
   {
        var objField = eval("document.main." + strFieldName);
        var strInitialColor = objField.value; 
        strPage = "/pop_ups/get_color.asp?Ref=" + strPage;
        var strReturnColor = showModalDialog(strPage,"","dialogWidth:35em; dialogHeight:20em");
        if (strReturnColor == null) { strReturnColor = strInitialColor }   
        objField.value = strReturnColor;
        objField.focus();	    
   }
   function GetDescription(strFrameName,strFieldName,strDescription)
   {
        if (strFrameName == null || strFrameName == "") {                                    
	        strDescription = eval(strFrameName + ".document.body.innerHTML");
	}
        else {
	        strFrameName = "";
	}
	var strLead = "<html>\n<head>\n<title>Input Help</title>\n";
        strLead = strLead + "<link rel=stylesheet type=text/css href='/stylesheets/stylesheet.css'>\n";
        strLead = strLead + "</head>\n<body bgcolor=#FFFFFF text=#000000>\n"; 
        strLead = strLead + "<fieldset>\n<legend>Input Help</legend>\n";
        strLead = strLead + "<table border=0 cellpadding=20 cellspacing=0>\n";
        strLead = strLead + "   <tr><td><BR>\n";
        strLead = strLead + "        <blockquote>\n" + strDescription + "\n        </blockquote>\n";
        strLead = strLead + "        <BR><BR><div align=center>\n<input class=button value='Close Window' type=button onclick='window.close();'></div><BR><BR></td>"; 
        strLead = strLead + "   </tr>\n</table>\n</fieldset>\n</body>\n</html>\n";
        preWindow = open('', 'previewWindow', 'width=200,height=200,status=no,scrollbars=no,resizable=no,toolbar=no,menubar=no');
        preWindow.document.open();
        preWindow.document.write(strLead);
        preWindow.document.close();
	if (strFrameName != "") {   
	   WYSIWYGFocus(strFrameName);
	}
	else {
	   var objField = eval("document.main." + strFieldName);
	   objField.focus();  
	}
   }
   function GetDisplayOrder(strFieldName,strItem,strFieldValue,intLevel,intType,strType,strPage,intArea,intParent,intTType,intPType)
   {
	if(strFieldName == null) { 
        strFieldName = "fDisplayOrder"; 
	}
	if(strPage == null) { strPage = "" }
	if(strItem == null) { strItem = "0" }
        var strURL = "/pop_ups/get_display_order.asp?Item=" + strItem + "&Page=" + strPage + "&FN=" + strFieldName + "&CTI=" + intType + "&LV=" + intLevel + "&CT=" + strType + "&AID=" + intArea + "&P=" + intParent + "&TT=" + intTType + "&PT=" + intPType;
        var arrVariablesToPass = showModalDialog(strURL,"","dialogWidth: 500px; dialogHeight: 500px; edge: Raised; center: Yes; help: No; resizable: Yes; status: No;");
        if (arrVariablesToPass != null) {
	   var intNumCount = arrVariablesToPass[0].toString();
           var objField = eval("document.main." + "fNumberCount");
           objField.value = intNumCount;
	   var strReturnValues = arrVariablesToPass[1].toString();
 	   var strFieldName = arrVariablesToPass[2].toString();
           var objField = eval("document.main." + "fDisplayFieldName");
           objField.value = strFieldName;
           var objField = eval("document.main.PopURL");
           objField.value = strReturnValues;
           document.forms.main.txtFocus.value = strFieldName;           
           document.main.intAction.value = 5;
           document.main.submit();
        }
   }
   function GetFile(strFieldName,strPage,strItem,strMode) 
   {  
	if(strFieldName == null) { 
          strFieldName = ""; 
	}
	if(strPage == null) { strPage = "" }
	if(strItem == null) { strItem = "0" }
	if(strMode == null) { strMode = "" }
        var arrVariablesToPass = new Array("",strPage,strItem);
        if (strMode != "Insert") {
		 arrVariablesToPass = showModalDialog("/pop_ups/upload_file.asp?Item=" + strItem + "&Page=" + strPage,arrVariablesToPass,"dialogWidth: 550px; dialogHeight: 400px; edge: Raised; center: Yes; help: No; resizable: Yes; status: No; toolbar: 1; menubar: 1;");
	}
	else {
		 arrVariablesToPass = showModalDialog("/pop_ups/get_file.asp?Item=" + strItem + "&Page=" + strPage,arrVariablesToPass,"dialogWidth: 500px; dialogHeight: 500px; edge: Raised; center: Yes; help: No; resizable: Yes; status: No;");
	}
        if (arrVariablesToPass != null) {
	        var strFilePath = arrVariablesToPass[0].toString();
	        if (strFilePath != null && strFilePath != "undefined" && strFilePath != "") {
               objField = eval("document.main." + strFieldName);
               if (typeof objField == 'object') {
                   objField.value = strFilePath;               
	           objField.focus();	    
                }
           }
	   else {
	      alert("You didn't choose a file! Please try again.");
              var objField = eval("document.all." + strFieldName);
              objField.focus;
	   }
        }
        else {
           alert("You didn't choose a file! Please try again.") 
           var objField = eval("document.all." + strFieldName);
           objField.focus;
        }
   }
   function GetImage(strFrameName,strFieldName,strPage,strItem,strMode) 
   {  
	if(strFrameName == null) { 
           strFrameName = "";
	}
	if(strFieldName == null) { 
           strFieldName = "ImageName"; 
	}
	else {
	   var strBaseName = Replace(strFieldName,"Name","")
	}
	if(strPage == null) { strPage = "" }
	if(strItem == null) { strItem = "0" }
	if(strMode == null) { strMode = "" }
        if (strBaseName == null || strBaseName == "undefined") { strBaseName = "Image"; }
        var arrVariablesToPass = new Array("",strPage,strItem,"",0,0,"center","0","0","0");
        if (strMode != "Upload") {
		arrVariablesToPass = showModalDialog("/pop_ups/get_image.asp?Item=" + strItem + "&Page=" + strPage,arrVariablesToPass,"dialogWidth: 500px; dialogHeight: 500px; edge: Raised; center: Yes; help: No; resizable: Yes; status: No;");
	}
	else {
		arrVariablesToPass = showModalDialog("/pop_ups/upload_image.asp?Item=" + strItem + "&Page=" + strPage,arrVariablesToPass,"dialogWidth: 550px; dialogHeight: 400px; edge: Raised; center: Yes; help: No; resizable: Yes; status: No; toolbar: 1; menubar: 1;");
	}
        if (arrVariablesToPass != null) {
           var strImagePath = arrVariablesToPass[0].toString();
           var strImageHeight = arrVariablesToPass[4].toString();
           var strImageWidth = arrVariablesToPass[5].toString();
           var strImageAlignment = arrVariablesToPass[6].toString();
           var strHSpace = arrVariablesToPass[7].toString();
           var strVSpace = arrVariablesToPass[8].toString();
           var strImageBorder = arrVariablesToPass[9].toString();
           if (strImagePath != null && strImagePath != "undefined" && strImagePath != "") {
              if(strFrameName != "" && strFrameName != "undefined" && strFrameName != "") { 
                var strImage = strImagePath + '"' + " align=" + strImageAlignment + " border=" + strImageBorder + " height=" + strImageHeight + " hspace=" + strHSpace + " vspace=" + strVSpace + " width=" + strImageWidth ;
                var strDocument = eval(strFrameName + ".document");
                strDocument.execCommand('insertimage',false,strImage);
                WYSIWYGFocus(strFrameName);
	      }
   	      else {
	        var strImage = "<img align=&quot;" + strImageAlignment + "&quot; border=&quot;" + strImageBorder + "&quot; height=&quot;" + strImageHeight + "&quot; hspace=&quot;" + strHSpace + "&quot; src=&quot;" + strImagePath + "&quot; vspace=&quot;" + strVSpace + "&quot; width=&quot;" + strImageWidth + "&quot;>"
	        var objField = eval("document.main." + strBaseName + "Height");
            objField.value = strImageHeight;
	        objField = eval("document.main." + strBaseName + "Width");
            objField.value = strImageWidth;
	        objField = eval("document.main." + strBaseName);
            objField.value = strImage;
	        objField = eval("document.main." + strFieldName);
            objField.value = strImagePath;
	        objField.focus();	    
            }
       }
	   else {
	      alert("You didn't choose an image! Please try again."); 
          var objField = eval("document.all." + strFieldName);
          objField.focus;
	   }
     }
     else {
       alert("You didn't choose an image! Please try again.") 
       var objField = eval("document.all." + strFieldName);
       objField.focus;
     }
   }
   function ProperCase(strWord2Change){
       var UCaseNext = false;
       var iLength = strWord2Change.length;
       if(iLength==0){ return ""}
       var strReturnValue = strWord2Change.charAt(0).toUpperCase();
       for(var iCounter=1;iCounter < iLength;iCounter++){
          if (UCaseNext == true){
             strReturnValue += strWord2Change.charAt(iCounter).toUpperCase();
          }
          else {
             strReturnValue += strWord2Change.charAt(iCounter).toLowerCase();
          }
          var iChar = strWord2Change.charCodeAt(iCounter);
          if(iChar == 45 || iChar == 46 || iChar == 32){
             UCaseNext = true;
          }
          else{
             if(iChar == 99 || iChar == 67){
                if(strWord2Change.charCodeAt(iCounter-1) == 77 || strWord2Change.charCodeAt(iCounter-1) == 109){
                  UCaseNext = true;
                }
             }
             else {
                UCaseNext = false;
             }
          }
       } 
       return strReturnValue;
   }             
   function TitleCase(str2Check) {
     var strWord;
     var isPrep;
     var arrWords = str2Check.split(" ");
     var arrPrepositions = Array("a","about","above","according to","across","after","against","ahead of","along","alongside","amid","among","an","and","apart from","as","aside from","as for","as of","as to","around","at","away from","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","by means of","concerning","consisting of","down","due to","during","except","except for","for","from","from among","in","in addition to","in back of","in front of","inside","in place of","in regard to","in spite of","instead of","into","like","near","Next to","nor","of","off of","on account of","or","out","onto","out of","outside","outside of","over","owing to","past","prior to","regarding","since","subsequent to","the","through","till","to it","to me","to the","to them","to us","to you","together with","toward","towards","throughout","under","underneath","until","up","upon","w/","w/o","w/out","w/ out","with","within","without");
     for (var iWordCounter = 0; iWordCounter < arrWords.length;iWordCounter++) {
        isPrep = false;
        for (var iPrepCounter = 0; iPrepCounter < arrPrepositions.length;iPrepCounter++) {
           if (arrWords[iWordCounter].toLowerCase() == arrPrepositions[iPrepCounter]) {
              isPrep = true;
              break;
           }
        }
        if (isPrep != true) { arrWords[iWordCounter] = ProperCase(arrWords[iWordCounter]) }               
        }
        str2Check = arrWords.join(" ");
        return str2Check;
   }    
   function WYSIWYGFocus(strFrameName)
   {
 	    var WYSIWYGEdit = eval(strFrameName + ".document");
        WYSIWYGEdit.focus();
        if (WYSIWYGEdit.body.createTextRange()) {			
           var WYSIWYGTextSelection = WYSIWYGEdit.body.createTextRange();
           WYSIWYGTextSelection.collapse(false);
           WYSIWYGTextSelection.select();          
        }
   }
   function WYSIWYGFormat(strFrameName,strFieldName)
   {    
	var WYSIWYGEdit = eval("document.main." + strFieldName);
        var WYSIWYGLocation = eval(strFrameName + ".document");
	    WYSIWYGEdit.value = WYSIWYGLocation.body.innerHTML;
        WYSIWYGLocation.body.innerHTML.style='input';
   }
   function GetWYSIWYGColor(strFrameName,strCommand,strPage)
   {
        var WYSIWYGLocation = eval(strFrameName + ".document");
        strPage = "/pop_ups/get_color.asp?Ref=" + strPage;
	    var strColor = showModalDialog(strPage,"","dialogWidth:35em; dialogHeight:20em");
	    if (strColor != null) {
           WYSIWYGLocation.execCommand(strCommand,false,strColor);
           WYSIWYGFocus(strFrameName);
           }
   }                              
   function GetWYSIWYGCommand(strFrameName,strCommand)
   {	 
	var WYSIWYGEdit = eval(strFrameName + ".document");
	if (WYSIWYGEdit.selection.createRange()) {
	    var WYSIWYGSelection = WYSIWYGEdit.selection.createRange();
	    WYSIWYGSelection.execCommand(strCommand);
        }
   	    WYSIWYGFocus(strFrameName);                                
   }	
   function GetWYSIWYGFormat(strFrameName,strCommand,strFieldName,strPrompt)
   {
	var WYSIWYGEdit = eval(strFrameName + ".document");
	if (WYSIWYGEdit.selection.createRange()) {
	    var WYSIWYGSelection = WYSIWYGEdit.selection.createRange();
	    WYSIWYGSelection.execCommand(strCommand,false,strPrompt);
        }
   	    WYSIWYGFocus(strFrameName);                                
   }
   function GetWYSIWYGPreview(strFrameName)
   {                                   
	var strHTML = eval(strFrameName + ".document.body.innerHTML");
	var strLead = "<html>\n<head>\n<title>Text Preview</title>\n";
        strLead = strLead + "<link rel=stylesheet type=text/css href='/stylesheets/stylesheet.css'>\n";
        strLead = strLead + "</head>\n<body bgcolor=#FFFFFF text=#000000>\n"; 
        strLead = strLead + "<fieldset>\n<legend>Preview Main Text Field</legend>\n";
        strLead = strLead + "<table border=0 cellpadding=20 cellspacing=0>\n";
        strLead = strLead + "   <tr><td>The text you are working on will be formatted as follows:<BR>\n";
        strLead = strLead + "        <blockquote>\n" + strHTML + "\n        </blockquote>\n";
        strLead = strLead + "        <BR><BR><div align=center>\n<input class=button value='Close Window' type=button onclick='window.close();'></div><BR><BR></td>"; 
        strLead = strLead + "   </tr>\n</table>\n</fieldset>\n</body>\n</html>\n";
        preWindow = open('', 'previewWindow', 'width=500,height=440,status=yes,scrollbars=yes,resizable=yes,toolbar=no,menubar=yes');
        preWindow.document.open();
        preWindow.document.write(strLead);
        preWindow.document.close();
        WYSIWYGFocus(strFrameName);
   }
   function GetWYSIWYGSelection(strFrameName,strCommand,strValue)
   {
        var WYSIWYGEdit = eval(strFrameName + ".document");
    	if(strValue != '') {
           WYSIWYGEdit.execCommand(strCommand,false,strValue);
        }
   	    WYSIWYGFocus(strFrameName);                                
   }	
   function GetWYSIWYGTable(strFrameName)
   {
       var intNumRows;
       var intNumColumns;
       var strAlignment;
       var strWidth;
       strIFrame = strFrameName;
       showModalDialog("/pop_ups/get_table.asp",window,"status:false; dialogWidth:25em; dialogHeight:25em");
   }
   function MakeWYSIWYGTable()
   {
       var WYSIWYGLocation = eval(strIFrame + ".document.selection.createRange()");
       var intRow=1;
       var intColumn=1;
       var strNewTable = "<div align=" + strAlignment + "><table border=1 cellpadding=5 cellspacing=0 align=" + strAlignment + " width=" + strWidth + ">";
       while (intRow <= intNumRows) {
          intRow=intRow+1;
          strNewTable = strNewTable + "<tr>";
          while (intColumn <= intNumColumns) {
             strNewTable = strNewTable + "<td>&nbsp;</td>";
	     intColumn=intColumn + 1;
	  }
	  intColumn=1;
	  strNewTable = strNewTable + "</tr>";
       }
       strNewTable = strNewTable + "</table></div>";
       WYSIWYGLocation.pasteHTML(strNewTable);
       WYSIWYGFocus(strIFrame);                                
   }
   function WYSIWYGPopulate(strFrameName,strFieldName,strStylesheet)
   {
	var WYSIWYGEdit = eval("document.main." + strFieldName);		
	var WYSIWYGLocation = eval(strFrameName + ".document");
	if (WYSIWYGLocation.body.innerHTML == "" ) {
	  WYSIWYGLocation.body.innerHTML = WYSIWYGEdit.value;
	  WYSIWYGLocation.createStyleSheet(strStylesheet);
	}
   }
   function ButtonDown(strBtn) 
   {    
      strBtn.style.borderColor = '#003333';
      strBtn.style.backgroundColor = '#006699';
   } 
   function ButtonOff(strBtn)
   {
  	   strBtn.style.borderColor = '#CCCCCC';  
  	   strBtn.style.backgroundColor = '#CCCCCC';
   }  
   function ButtonOn(strBtn) 
   {
      strBtn.style.borderColor = '#006699';
      strBtn.style.backgroundColor = '#666666';
      strBtn.style.cursor = 'hand';	
   }
   function ButtonUp(strBtn)  
   {
      strBtn.style.borderColor = '#CCCCCC';  
      strBtn.style.backgroundColor = '#CCCCCC';
   }  
   function SubmitButtonOn(strBtn) 
   {
      strBtn.style.borderColor = '#333333';
      strBtn.style.backgroundColor = '#cccccc';
      strBtn.style.cursor = 'hand';	
   }
   function SubmitButtonOff(strBtn)
   {
      strBtn.style.borderColor = '#cccccc';  
      strBtn.style.backgroundColor = '#ebebeb';
   }  
   function FormChange(thisform,thisname,intAction) 
   {
	if (ValueCheck(intAction) == false) {
           intAction = 2
        }
        if (typeof arguments[0] != 'object') {
          thisform = eval("document.main")
        }
	thisform.intAction.value = intAction;
	thisform.txtFocus.value = thisname;
	thisform.submit();
   }
   function Replace(strContent,strSearchFor,strReplaceWith,intStart,intCount,intCompare) 
   {
	if (ValueCheck(strContent) != true || ValueCheck(strSearchFor) != true) { return strContent; }
	if (ValueCheck(intCompare) != true ) { intCompare = 0 }
	if (ValueCheck(intCount) != true ) { intCount = -1 }
	if (ValueCheck(intStart) != true ) { intStart = 0 }
	if (intStart > strContent.length) { 
		return strContent;	}		
	else if (intStart < 1) {
		intStart = 0
	}
	else {
		intStart = intStart - 1
	}		
	if (intCount == -1) {		
		if (AlphaNumCheck(strSearchFor) != true) {
			var strTmp = new RegExp("\\" + strSearchFor,"g")		
		}
		else if (intCompare == 1) {
			var strTmp = new RegExp(strSearchFor, "gi")		
		}
		else {
			var strTmp = new RegExp(strSearchFor, "g")		
		}
		arrCount = strContent.match(strTmp)
		if (arrCount != null) {
			intCount = arrCount.length
		}
		else {
			intCount = 0
		}
	}
	for (var i=0; i < intCount; i++){
		if (intCompare == 1) {
			strContent = CaseInsensitiveReplace(strContent,strSearchFor,strReplaceWith,intStart) 
		}
		else {
			strContent = CaseSensitiveReplace(strContent,strSearchFor,strReplaceWith,intStart) 
		}
	}	
	return strContent;
   }
   function Trim(str2Trim) 
   {
     if (ValueCheck(str2Trim) != false) {
        return str2Trim.replace(/^\s*|\s*$/g,"");
     }
     else {
        return "";
     }
   }
   function ValueCheck(str2Test) 
   {
      if (str2Test == null || str2Test == "" || str2Test == 'undefined' || str2Test.length < 1) {
	 return false;
      }
      else { 
	 return true;
      }
   }
   function AlphaNumCheck(str2Test){
      var regEx=/[0-9A-Za-z]/;
      if(regEx.test(str2Test)){
         return true;
      } 
      else {
         return false;
      }
   }	
   function CaseInsensitiveReplace(strContent,strSearchFor,strReplaceWith,intStart) {
      var tmpContent = strContent;
      var tmpBefore = new String();
      var tmpAfter = new String();
      var tmpOutput = new String();
      var intBefore = 0;
      var intAfter = 0;
      if (tmpContent.toUpperCase().indexOf(strSearchFor.toUpperCase()) > -1) {	
          intBefore = tmpContent.toUpperCase().indexOf(strSearchFor.toUpperCase());
          tmpBefore = tmpContent.substring(intStart, intBefore);
          tmpOutput = tmpOutput + tmpBefore;
          tmpOutput = tmpOutput + strReplaceWith;
          intAfter = tmpContent.length - strSearchFor.length + 1;
          tmpContent = tmpContent.substring(intBefore + strSearchFor.length);
      }
      return tmpOutput + tmpContent;
   }
   function CaseSensitiveReplace(strContent,strSearchFor,strReplaceWith,intStart) {
      var tmpContent = strContent;
      var tmpBefore = new String();
      var tmpAfter = new String();
      var tmpOutput = new String();
      var intBefore = 0;
      var intAfter = 0;
      if (tmpContent.indexOf(strSearchFor) > -1) {	
          intBefore = tmpContent.indexOf(strSearchFor);
          tmpBefore = tmpContent.substring(intStart, intBefore);
          tmpOutput = tmpOutput + tmpBefore;
          tmpOutput = tmpOutput + strReplaceWith;
          intAfter = tmpContent.length - strSearchFor.length + 1;
          tmpContent = tmpContent.substring(intBefore + strSearchFor.length);
      }
      return tmpOutput + tmpContent;
   }
   function DeleteRelatedPage(intRelatedItemID,strType)
   {
      document.forms.main.intAction.value = 3.1;
      document.forms.main.RIType.value = strType;
      document.forms.main.RI.value = intRelatedItemID
      document.forms.main.submit();
   }
  function AddNew(strType)
  {   
    document.forms.main.intAction.value = 3.2;
    document.forms.main.RIType.value = strType;
    document.forms.main.submit();
  }
  function MarkProgress(strStepID)
  {
    var objMarkedProgress = eval("document.all." + strStepID + ".style");
    objMarkedProgress.backgroundColor='000000';
   }
  function getIndex(strFieldName) {
    var strField = eval('document.main.' + strFieldName)
    for (var i=0;i<document.main.elements.length;i++) {
        if (strField == document.main.elements[i]) {
            return i;
        }
    }
    return 0;
  }  
  function ViewIFRAME(DisplayLink,CloseLink,FrameName,strType,intPageID) {
    if (intPageID == null || intPageID == "") {                                    
        intPageID = 0;
    }
    if (intPageID == 0) {                                    
        document.forms.main.intAction.value = 3.3;
        document.forms.main.RIType.value = strType;
        document.forms.main.submit();
    }
    else {
        document.getElementById(DisplayLink).style.display = "none";
        document.getElementById(CloseLink).style.display = "";
        document.getElementById(FrameName).style.display = "";
        WYSIWYGFocus(FrameName);
    }
  }
  function HideIFRAME(DisplayLink,CloseLink,FrameName) {
    document.getElementById(DisplayLink).style.display = "";
    document.getElementById(CloseLink).style.display = "none";
    document.getElementById(FrameName).style.display = "none";
    document.forms.main.intAction.value = 2;
    document.forms.main.txtFocus.value = 'WYSIWYGPageText'
    document.forms.main.submit();
  }

function CheckSpell() { 
   try { 
       var tmpis = new ActiveXObject("ieSpell.ieSpellExtension"); 
       tmpis.CheckAllLinkedDocuments(document); 
   } 
   catch(exception) { 
       if(exception.number==-2146827859) { 
           if (confirm("ieSpell not detected.  Click Ok to go to download page.")) 
               window.open("http://www.iespell.com/download.php","DownLoad"); 
       } else { 
           alert("Error Loading ieSpell: Exception " + exception.number); 
       } 
   } 
} 

function NiftyCheck(){
if(!document.getElementById || !document.createElement)
    return(false);
isXHTML=/html\:/.test(document.getElementsByTagName('body')[0].nodeName);
if(Array.prototype.push==null){Array.prototype.push=function(){
      this[this.length]=arguments[0]; return(this.length);}}
return(true);
}

function Rounded(selector,wich,bk,color,opt){
var i,prefixt,prefixb,cn="r",ecolor="",edges=false,eclass="",b=false,t=false;

if(color=="transparent"){
    cn=cn+"x";
    ecolor=bk;
    bk="transparent";
    }
else if(opt && opt.indexOf("border")>=0){
    var optar=opt.split(" ");
    for(i=0;i<optar.length;i++)
        if(optar[i].indexOf("#")>=0) ecolor=optar[i];
    if(ecolor=="") ecolor="#666";
    cn+="e";
    edges=true;
    }
else if(opt && opt.indexOf("smooth")>=0){
    cn+="a";
    ecolor=Mix(bk,color);
    }
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
else if(wich.indexOf("top")>=0) t="true";
else if(wich.indexOf("tl")>=0){
    t="true";
    if(wich.indexOf("tr")<0) prefixt+="l";
    }
else if(wich.indexOf("tr")>=0){
    t="true";
    prefixt+="r";
    }
if(wich.indexOf("bottom")>=0) b=true;
else if(wich.indexOf("bl")>=0){
    b="true";
    if(wich.indexOf("br")<0) prefixb+="l";
    }
else if(wich.indexOf("br")>=0){
    b="true";
    prefixb+="r";
    }
var v=getElementsBySelector(selector);
var l=v.length;
for(i=0;i<l;i++){
    if(edges) AddBorder(v[i],ecolor);
    if(t) AddTop(v[i],bk,color,ecolor,prefixt);
    if(b) AddBottom(v[i],bk,color,ecolor,prefixb);
    }
}

function AddBorder(el,bc){
var i;
if(!el.passed){
    if(el.childNodes.length==1 && el.childNodes[0].nodeType==3){
        var t=el.firstChild.nodeValue;
        el.removeChild(el.lastChild);
        var d=CreateEl("span");
        d.style.display="block";
        d.appendChild(document.createTextNode(t));
        el.appendChild(d);
        }
    for(i=0;i<el.childNodes.length;i++){
        if(el.childNodes[i].nodeType==1){
            el.childNodes[i].style.borderLeft="1px solid "+bc;
            el.childNodes[i].style.borderRight="1px solid "+bc;
            }
        }
    }
el.passed=true;
}
    
function AddTop(el,bk,color,bc,cn){
var i,lim=4,d=CreateEl("b");
if(cn.indexOf("s")>=0) lim=2;
if(bc) d.className="artop";
else d.className="rtop";
d.style.backgroundColor=bk;
for(i=1;i<=lim;i++){
    var x=CreateEl("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    if(bc) x.style.borderColor=bc;
    d.appendChild(x);
    }
el.style.paddingTop=0;
el.insertBefore(d,el.firstChild);
}

function AddBottom(el,bk,color,bc,cn){
var i,lim=4,d=CreateEl("b");

if(cn.indexOf("s")>=0) lim=2;
if(bc) d.className="artop";
else d.className="rtop";
d.style.backgroundColor=bk;
for(i=lim;i>0;i--){
    var x=CreateEl("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    if(bc) x.style.borderColor=bc;
    d.appendChild(x);
    }
el.style.paddingBottom=0;
el.appendChild(d);
}

function CreateEl(x){
if(isXHTML) return(document.createElementNS('http://www.w3.org/1999/xhtml',x));
else return(document.createElement(x));
}

function getElementsBySelector(selector){
var i,selid="",selclass="",tag=selector,f,s=[],objlist=[];

if(selector.indexOf(" ")>0){  //descendant selector like "tag#id tag"
    s=selector.split(" ");
    var fs=s[0].split("#");
    if(fs.length==1) return(objlist);
    f=document.getElementById(fs[1]);
    if(f) return(f.getElementsByTagName(s[1]));
    return(objlist);
    }
if(selector.indexOf("#")>0){ //id selector like "tag#id"
    s=selector.split("#");
    tag=s[0];
    selid=s[1];
    }
if(selid!=""){
    f=document.getElementById(selid);
    if(f) objlist.push(f);
    return(objlist);
    }
if(selector.indexOf(".")>0){  //class selector like "tag.class"
    s=selector.split(".");
    tag=s[0];
    selclass=s[1];
    }
var v=document.getElementsByTagName(tag);  // tag selector like "tag"
if(selclass=="")
    return(v);
for(i=0;i<v.length;i++){
    if(v[i].className.indexOf(selclass)>=0){
        objlist.push(v[i]);
        }
    }
return(objlist);
}

function Mix(c1,c2){
var i,step1,step2,x,y,r=new Array(3);
if(c1.length==4)step1=1;
else step1=2;
if(c2.length==4) step2=1;
else step2=2;
for(i=0;i<3;i++){
    x=parseInt(c1.substr(1+step1*i,step1),16);
    if(step1==1) x=16*x+x;
    y=parseInt(c2.substr(1+step2*i,step2),16);
    if(step2==1) y=16*y+y;
    r[i]=Math.floor((x*50+y*50)/100);
    }
return("#"+r[0].toString(16)+r[1].toString(16)+r[2].toString(16));
}
//-->    

