<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0042)http://www.webmascon.com/orphus/orphus.htm -->
<!-- 
// COPYRIGHT
// ~~~~~~~~~
// Original idea of Orphus system belongs to Dmitry Koteroff.
// If you want to modify this script, please contact 
// the author first: http://forum.dklab.ru/other/orphus/
//
// You may use this script "as is" with no restrictions.
// Please do not remove these comments.
--><HTML xml:lang="en" 
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Orphus</TITLE>
<META content="text/html; charset=windows-1251" http-equiv=Content-type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR></HEAD>
<BODY background=orphus.files/orphus.gif bgColor=white>
<DIV>
<FORM action=#dynamic id=form method=post target=orphusNullFrame>
<DIV><INPUT name=version type=hidden> <INPUT name=email type=hidden> <INPUT 
name=subject type=hidden> <INPUT name=to type=hidden> <INPUT name=ref 
type=hidden> <INPUT name=c_pre type=hidden> <INPUT name=c_sel type=hidden> 
<INPUT name=c_suf type=hidden> <INPUT name=c_pos type=hidden> <INPUT 
name=charset type=hidden> <!-- v3.x --><INPUT name=Address type=hidden> <INPUT 
name=Context type=hidden> 
</DIV></FORM><BR><BR><BR><BR><BR><BR><BR><BR><BR><IFRAME height=1 
name=orphusNullFrame src="about:blank" width=1></IFRAME></DIV>
<SCRIPT type=text/javascript><!--//--><![CDATA[//><!--
document.body.style.cursor = "hand";   // CSS 1.0 Strict

var orphus = {
	version:  "3.2",
	email:    "", // dynamically filled
	language: "ru",
	hq:       "http://orphus.ru",
	seltag1:  "<!!!>",
	seltag2:  "<!!!>",
	contunit: "word",
	contlen:  10,
	maxlen:   256,
	lng: {
		alt:        "Выделите орфографическую ошибку мышью и нажмите Ctrl+Enter. Сделаем язык чище!",
		badbrowser: "Ваш браузер не поддерживает возможность перехвата выделенного текста или IFRAME. Возможно, слишком старая версия, а возможно, еще какая-нибудь ошибка.",
		toobig:     "Вы выбрали слишком большой объем текста!",
		thanks:     "Спасибо за сотрудничество!",
		subject:    "Орфографическая ошибка",
		docmsg:     "Документ:",
		intextmsg:  "Орфографическая ошибка в тексте:",
		ifsendmsg:  "Послать сообщение об ошибке автору?\nВаш браузер останется на той же странице.",
		gohome:     "Перейти на домашнюю страницу системы Orphus?",
		newwin:     "Страница откроется в новом окне.",
		name:       "Система Orphus", 
		author:     "Автор: Дмитрий Котеров.",
		to:         "Пользователь Orphus" 
	},
	init: function() { with (this) {
		var th = this;
		// Fetch email. We have to do it so hard in case of opening orphus
		// document using file:// scheme on IE4 (and older browsers).
		if (email == "") {
			var d=parent.document, e=null, src = null;
			if (d.all && d.all.orphus && (src=d.all.orphus.src));
			else if (d.getElementById && (e=d.getElementById("orphus")) && (src=e.src));
			else if (location) src = location.hash;
			if (src) email = src.replace(new RegExp("^.*#", ""), "");
		}
		// Unmangle e-mail (antispam).
		if (email.substr(0,1) == "!") 
			email = email.substr(1).replace(new RegExp("(.)(.)", "g"), "$2$1");
		// Set img parameters.
		document.body.title = lng.alt;
		document.body.onclick = function () { return th.imgclick(this) };
		// Set link.
		if (parent != window) {
			lng.gohome += " " + lng.newwin;
		}
		// Set form.
		document.forms['form'].action = hq;
		// Hook keyboard.
		parent.document.onkeypress = function(e) { return th.onkeypress(e) };
	}},

	imgclick: function(a) { with (this.lng) {
		if (confirm(name+" v"+this.version+".\n"+author+"\n\n"+alt+"\n\n"+gohome)) {
			window.open(this.hq, parent==window?'_self':'_blank');
		}
		return false
	}},

	thanks: function() {
		orphus_thanks(0, this.lng.thanks);
	},

	send: function(url, context) { with (this) {
		var form = document.forms['form'];
		if (!form) return;
		form.version.value = version;
		form.email.value = email;
		form.to.value = lng.to;
		form.subject.value = lng.subject;
		form.ref.value = url;
		form.c_pre.value = context[0];
		form.c_sel.value = context[1];
		form.c_suf.value = context[2];
		form.c_pos.value = context[3];
		// Characters are in UNICODE while copying to the form - we do not care of parent charset!
		form.charset.value = document.charset || "windows-1251"; 
		// v3.x. {{{
		form.Address.value = form.ref.value;
		form.Context.value = form.c_pre.value+seltag1+form.c_sel.value+seltag2+form.c_suf.value;
		// }}}
		form.submit();
	}},

	stripSlashn: function(text) {
		text = ""+text;
		return text.replace("\r", "").replace("\n", "").replace(new RegExp("^\\s+|\\s+$", "g"), "");
	},

	doSend: function() { with (this) {
		var text = null;
		if (!email || navigator.appName.indexOf("Netscape")!=-1 && eval(navigator.appVersion.substring(0,1))<5) {
			alert(lng.badbrowser);
			return;
		}
		var w = parent;
		var selection = null;
		if (w.getSelection) {
			text = w.getSelection();
		} else if (w.document.getSelection) {
			text = w.document.getSelection();
		} else {
			selection = w.document.selection;
		}
		var context = null;
		if (selection) {
			var r = selection.createRange(); if (!r) return;
			text = r.text;
			var s = 0; 
			while (text.charAt(s)==" " || text.charAt(s)=="\n") s++;
			var e = 0; 
			while (text.charAt(text.length-e-1)==" " || text.charAt(text.length-e-1)=="\n") e++;
			var rngA = selection.createRange();
			rngA.moveStart(contunit, -contlen);
			rngA.moveEnd("character", -text.length+s);
			var rngB = selection.createRange();
			rngB.moveEnd(contunit, contlen);
			rngB.moveStart("character", text.length-e);
			text     = text.substring(s, text.length-e);
			context  = [rngA.text,  text,  rngB.text, 0];
		} else {
			context = ["", text, "", -1];
		}
		if (text == null) { 
			alert(orphus.badbrowser); 
			return; 
		}
		if (context[1] == "") return;
		var visCont = stripSlashn(context[0]+seltag1+context[1]+seltag2+context[2]);
		if (visCont.length > maxlen) {
			alert(lng.toobig);
			return;
		}
		var url = w.document.location.href;
		if (confirm(lng.docmsg+"\n   "+url+"\n"+lng.intextmsg+'\n   "'+visCont+'"\n\n'+lng.ifsendmsg)) {
			this.send(url, context);
			this.thanks();
		}
	}},

	onkeypress: function(e) { with (this) {
		var pressed=0;
		var we = null;
		if (window.event) we = window.event;
		else if (parent && parent.event) we = parent.event;
		if (we) {
			// IE & Opera
			pressed = we.keyCode==10 ||  // IE
				(we.keyCode == 13 && we.ctrlKey); // Opera 
		} else if (e) {
			// NN
			pressed = 
				(e.which==10 && e.modifiers==2) || // NN4
				(e.keyCode==0 && e.charCode==106 && e.ctrlKey) ||
				(e.keyCode==13 && e.ctrlKey) // Mozilla
		}
		if (pressed) this.doSend();
	}}
}
orphus.init();

function orphus_thanks(n, text) {
	if (!n) n = 0;
	if (n>20) return;
	status = (n%5)? text : ' ';
	setTimeout("orphus_thanks("+(n+1)+", '"+text+"')", 100);
}
//--><!]]></SCRIPT>
</BODY></HTML>
