sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function toggle(targetId) {
         target = document.all(targetId);
         if (target.style.display == "none")
             {
             target.style.display="";
             }
         else
             {
             target.style.display="none";
             }
         }

function GetSelectedItem() {
         chosen = ""
         len = document.f1.r1.length

                                 for (i = 0; i <len; i++) {
                                 if (document.f1.r1[i].checked) {
                                 chosen = document.f1.r1[i].value
                                 }
                                 }

                                 if (chosen == "") {
                                 return ""

                                 }
                                 else {

                                         d = chosen
                                 return (d)

                                 }
                                 }


function doallways()
{
var my_string = document.getElementById('iView').contentWindow.document.body.innerHTML;

my_string = my_string.replace( /<(.*)><\/\1>/g, '' );
my_string = my_string.replace( /< (.*)> <\/\1>/g, '' );
my_string = my_string.replace( /<a .*><\/a>/g, '' );
my_string = my_string.replace( /<a .*> <\/a>/g, '' );
my_string = my_string.replace( /<H.*>&nbsp;<\/H.*>/g, '<P></P>' );
my_string = my_string.replace(/<FONT.*>(.*)<\/FONT>/g, "$1");
my_string = my_string.replace( /<P .*>(.*)<\/P>/g, "<P>$1</P>" );



document.getElementById('iView').contentWindow.document.body.innerHTML = my_string ;

}



  function selOn(ctrl)
  {
        ctrl.style.borderColor = '#000000';
        ctrl.style.backgroundColor = '#B5BED6';
        ctrl.style.cursor = 'hand';
  }

  function selOff(ctrl)
  {
        ctrl.style.borderColor = '#D6D3CE';
        ctrl.style.backgroundColor = '#D6D3CE';
  }

  function selDown(ctrl)
  {
        ctrl.style.backgroundColor = '#8492B5';
  }

  function selUp(ctrl)
  {
    ctrl.style.backgroundColor = '#B5BED6';
  }

  function doBold()
  {
        iView.document.execCommand('bold', false, null);
  }

  function doBulList()

{

iView.document.execCommand('insertunorderedlist', false, null);

}
function doIndent()

{

iView.document.execCommand('Indent', false, null);

}
function doOutdent()

{

iView.document.execCommand('Outdent', false, null);

}

  function doItalic()
  {
        iView.document.execCommand('italic', false, null);
  }

  function doUnderline()
  {
        iView.document.execCommand('underline', false, null);
  }

  function doForeCol(fCol)
  {

    if(fCol != '')
      iView.document.execCommand('forecolor', false, fCol);
  }

  function doBackCol(bCol)
  {
    if(bCol != null)
      iView.document.execCommand('backcolor', false, bCol);
  }

  function doLink()
  {
    iView.document.execCommand('createlink');
  }


  function doSize(fSize)
  {
    if(fSize != '')
      iView.document.execCommand('fontsize', false, fSize);
  }
function doFont(fName)
{
if(fName != '')
iView.document.execCommand('fontname', false, fName);
} 

  function doHead(hType)
  {
    if(hType != '')
    {
      iView.document.execCommand('formatblock', false, hType);
      doFont(selFont.options[selFont.selectedIndex].value);
    }
  }


                                 function savedocument()
                                 {

                                 document.post.msg.value=iView.document.body.innerHTML;

                                 document.post.submit(); // submit form for save

                                 }

                                 function Init()
                                 {
                                 iView.document.designMode = 'On';

                                 }
