PositionX = 20;
PositionY = 20;


defaultWidth  = 400;
defaultHeight = 300;


var AutoClose = false;


if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('if (window.Event) document.captureEvents(Event.MOUSEUP);');
writeln('function nocontextmenu()  {event.cancelBubble = true;event.returnValue = false;return false;}')
writeln('function norightclick(e) {if (window.Event) { if (e.which == 2 || e.which == 3) {alert("Все закопирайчено!")}}');
writeln('else if (event.button == 2 || event.button == 3) { alert("Все закопирайчено!")}}');
writeln( 'function winclose() {window.close();}');
writeln('document.onleftclick = winclose;');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["CCM"].width;');writeln('window.innerHeight=document.images["CCM"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=333333 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=333333 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="CCM" src='+imageURL+' style="display:block; cursor: hand"></body></html>');
close();		
}}

function openWin(winName, URL, Height, Width) {

      thisString = "width=" + Width + ",height=" + Height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,top=30,left=30";

      winName = window.open(URL,winName,thisString);

      }

// добавлено из errorcheck

function errorcheck()
{
// Создать переменные для сценария
var ermes = "";
var fio = "";
var email = "";

fio = document.forms['sendform'].elements['fio'].value;
email = document.forms['sendform'].elements['email'].value;

if ( (!fio) || (!email))
{
	if (!fio) {ermes="- your name\n"}
	if (!email) {ermes=ermes+"- your e-mail\n"}
}

if (ermes)
{
	almes = "Please, fill the fields:\n";
	almes = almes + ermes;

	alert (almes);
	document.forms['sendform'].elements['fio'].focus();	
	return false;
}
else
{
	if (!mailcheck())
	{
	almes = "Their is an error in the field [e-mail]:\n";
	almes = almes + email + "\n";
	almes = almes + "Change your information.\n";

	alert (almes);
	document.forms['sendform'].elements['email'].focus();	
	return false;
	}
	else
	{
	document.forms['sendform'].submit();
	}
}

}

function mailcheck()
{
ee = document.forms['sendform'].elements['email'].value;
emValue = new String( ee );
hasat=emValue.indexOf("@");
haspo=emValue.indexOf(".");
	if (( hasat == -1) || (haspo == -1 ) )
	{ return false; }
	else { return true; }
}



