

function checkform()
{



if (document.form.name_o.value=="Имя отправителя" )
  {
alert("Введите имя отправителя");
document.form.name_o.focus();
return false;
  }
else if (document.form.name_p.value=="Имя получателя" )
  {
alert("Введите имя получателя");
document.form.name_p.focus();
return false;
  }
else if (document.form.mail_o.value=="E-mail отправителя" || document.form.mail_o.value.indexOf ('@')==-1 || document.form.mail_o.value.indexOf ('.')==-1)
  {
alert("Введите E-mail отправителя");
document.form.mail_o.focus();
return false;
  }
else if (document.form.mail_p.value=="E-mail получателя" || document.form.mail_p.value.indexOf ('@')==-1 || document.form.mail_p.value.indexOf ('.')==-1)
  {
alert("Введите E-mail получателя");
document.form.mail_p.focus();
return false;
  }
else if (document.form.text.value=="" )
  {
alert("Введите текст");
document.form.text.focus();
return false;
  }



}



	function addBBcode(textin,textout) {
	if(document.form.text.createTextRange && document.form.text.caretPos) {
		var caretPos = document.form.text.caretPos;
		var insert = textin + caretPos.text + textout;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? insert + ' ' : insert;
	} else {
		document.form.text.value += textin+textout;
	}
	document.form.text.focus(caretPos);
}



    function sm(p,x,y) {
    window.open(p, '_blank', 'resizeable=no,scrollbars=no,AdMcha=no,toolbar=no,menubar=no,location=no,width='+x+',height='+y);
  }
  
  function textaa(p,x,y) {
    window.open(p, '_blank', 'resizeable=yes,scrollbars=yes,AdMcha=no,toolbar=no,menubar=no,location=no,width='+x+',height='+y);
  }
  


  	function nstep () {
			    document.form.submit.disabled=true;
			    document.form.submit2.disabled=true;
			    document.form.dv.disabled=true;
			    return true;
			
	
	}




function ShowHide(id1, id2) {
	  if (id1 != '') expMenu(id1);
	  if (id2 != '') expMenu(id2);
	}
	
	function expMenu(id) {
	  var itm = null;
	  if (document.getElementById) {
		itm = document.getElementById(id);
	  } else if (document.all){
		itm = document.all[id];
	  } else if (document.layers){
		itm = document.layers[id];
	  }
	
	  if (!itm) {
	   // do nothing
	  }
	  else if (itm.style) {
		if (itm.style.display == "none") { itm.style.display = ""; }
		else { itm.style.display = "none"; }
	  }
	  else { itm.visibility = "show"; }
	}







function subjch()
{
 sel=document.form.subj.selectedIndex
 if(document.form.subj.options[sel].text.substring(0,1)=="-")
 {
  val=prompt("Введите текст:",document.forms[0].subj.options[sel-1].text)
  if(val==null) val=""
  if (val.length > 20) {
	alert ("Слишком длинный заголовок");
	val = val.substr(0,20);
  }
  document.form.subj.options[sel-1].text=""+val
  document.form.subj.selectedIndex=sel-1
  document.form.subj1.value=""+val
 }

}



function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",10)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=50
}
function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+5
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}







