var loc = window.location;
var mis;
nN = navigator.appName; 


function winop()
{
//?змените эту строку:
//phploc = "/../js/mistakes/mistakes.php";
//windop = window.open
//(phploc,"mywin","scrollbars=0,statusbar=0,resizable=0,height=340,width=540");


ShowModalbox();
}



function getText(e) 
{	
	if (!e) e= window.event; 
	if((e.ctrlKey) && ((e.keyCode==10)||(e.keyCode==13))) 
	{ 
		if(nN == 'Microsoft Internet Explorer')
{if(document.selection.createRange())
{var range = document.selection.createRange();
        mis = range.text;
winop();}} 
else 
{if (window.getSelection()) 
{mis = window.getSelection();
winop();} 

else if(document.getSelection())
{mis = document.getSelection();
winop();}}
    return true;} 
    return true;}

document.onkeypress = getText;


/////////////
var modalbox;
var shade;
var scrollWidth;
var scrollHeight;
 
window.onload = function() {
 
modalbox = document.getElementById("modalbox");
shade = document.getElementById("shade");
 
scrollWidth = document.body.scrollWidth;
scrollHeight = document.body.scrollHeight;
 
document.getElementById("main").style.width = scrollWidth;
document.getElementById("main").style.height = scrollHeight;
 
}
 
function ShowModalbox() {
 
document.getElementById("main").style.filter = "alpha(opacity=80)";
document.getElementById("main").style.opacity = 0.8;
document.getElementById("main").style.display = "block";
 
modalbox.style.display = "block";
shade.style.display = "block";
 
posleft = Math.round(scrollWidth / 2) - 150;
postop = document.body.scrollHeight - 600;
 
shade.style.left = posleft + 7;
shade.style.top = document.body.scrollTop + 307;
 
modalbox.style.left = posleft;
modalbox.style.top = document.body.scrollTop + 300;

document.forms.mistake.mis.value=mis;
//document.forms.mistake.url.value=loc;
document.forms.mistake.comment.value=''; 
}
 
function LogIn() {
 
HideModalbox();
document.location.href = "http://www.webobzor.net/";
 
}
 
function HideModalbox() {
 
document.getElementById("main").style.display = "none";
modalbox.style.display = "none";
shade.style.display = "none";
 
}


function readtxt()
{ p=opener
 if(p.mis === undefined)p.mis=""
 if(p!=null)document.forms.mistake.url.value=p.loc
 if(p!=null)document.forms.mistake.mis.value=p.mis
}
