

var on = new Array();
var off = new Array();

function preload()
{
var imgdir='i/';
for (var i=0; i<arguments.length; i++)
{
image = arguments[i];
on[image] = new Image();
off[image] = new Image();
imgon = imgdir + image + '_on.gif';
imgoff = imgdir + image + '.gif';
on[image].src = imgon;
off[image].src = imgoff;
}
}

// hide mail address function
var myMail = 'office';
var myDomain = 'sema.ru';
function insertMail(cl, pic) {
	var mailString = myMail+'@'+myDomain;
	document.write(' <a href="mailto:'+mailString+'"');
	if (cl)	document.write(' class="'+cl+'"');
	document.write('>');
	if (!pic) {
	document.write(mailString);
	} else {
	document.write(pic);
	}
	document.write('</a> ');
}



function over(img) { document.images[img].src = on[img].src; }
function out(img) { document.images[img].src = off[img].src; }

home_out = new Image();
mail_out = new Image();
search_out = new Image();
smap_out = new Image();

home_ovr = new Image();
mail_ovr = new Image();
search_ovr = new Image();
smap_ovr = new Image();

home_ovr.src = "i/homedesc.gif";
mail_ovr.src = "i/maildesc.gif";
search_ovr.src = "i/searchdesc.gif";
smap_ovr.src = "i/smapdesc.gif";

home_out.src = "i/1.gif";
mail_out.src = "i/1.gif";
search_out.src = "i/1.gif";
smap_out.src = "i/1.gif";

function over2(img) { var imgovr = eval(img + "_ovr.src"); document.images['desc'].src = imgovr; }
function out2(img) { var imgoff = eval(img + "_out.src"); document.images['desc'].src = imgoff; }
function qnav(l) { if (l.options[l.selectedIndex].value == "") { l.selectedIndex = 0; } else { top.location.href = l.options[l.selectedIndex].value; } }


function view(wurl,ww,wh,wname) {

	wleft=window.screenLeft;
	wtop=window.screenTop;

	w=document.body.clientWidth;
	h=document.body.clientHeight;

	w1=wleft+(w/2)-(ww/2);
	h1=wtop-40;

	feat='"toolbar=no,location=no,directories=no,status=no,menubar=no,fullscreen=no,scrollbars=yes,resizable=yes,width='+ww+',height='+wh+',left='+w1+',top='+h1+'"';

	newWindow=window.open(wurl,wname, feat);
//	newWindow.resizeTo(ww+28, wh+27);
}
function sticker() {

	ww = 300;
	wh = 300;

	wleft=window.screenLeft;
	wtop=window.screenTop;

	w=document.body.clientWidth;
	h=document.body.clientHeight;

	w1=wleft+(w/2)-(ww/2);
	h1=wtop-40;

	feat='"toolbar=no,location=no,directories=no,status=no,menubar=no,fullscreen=no,scrollbars=no,resizable=yes,width='+ww+',height='+wh+',left='+w1+',top='+h1+'"';

	newWindow=window.open('/index.sema?a=check_cookies&no_design=1',null, feat);
	newWindow.resizeTo(ww+28, wh+27);
}

function view2(ww, wh, picname, title) {
	
	wleft=window.screenLeft;
	wtop=window.screenTop;
	
	w=document.body.clientWidth;
	h=document.body.clientHeight;
	
	w1=wleft+(w/2)-(ww/2);
	h1=wtop-40;
	
	feat=' "toolbar=no,location=no,directories=no,status=no,menubar=no,fullscreen=no,scrollbars=no, resizable=yes, width=' +ww+ ', height=' +wh+  ', left='+w1+', top='+h1+' "';
	
	newWindow=window.open('','Photos', feat);
	// Set Content
	newWindow.resizeTo(ww+28, wh+31);
	newContent='<html><head><title>' + title + '</title><script language="JavaScript" src="/script.js"></script></HEAD>';
	newContent+='<body topmargin="0" leftmargin="0"><a href="javascript:self.close()"><center>';
	newContent+='<img src="' + picname  + '" border="0" alt="Закрыть"></a>';
	newContent+='</center></body></html>';
	
	// Write content
	newWindow.document.write(newContent);
	newWindow.document.close();
	
	

}


/*
function view(wurl,ww,wh,wname) {

	wleft=window.screenLeft;
	wtop=window.screenTop;

	w=document.body.clientWidth;
	h=document.body.clientHeight;
	
	w1=wleft+(w/2)-(ww/2);
	h1=wtop-40;
	
	feat='"toolbar=no,location=no,directories=no,status=no,menubar=no,fullscreen=no,scrollbars=no,resizable=no,width='+ww+',height='+wh+',left='+w1+',top='+h1+'"';
	
	newWindow=window.open(wurl,wname, feat);
	newWindow.resizeTo(ww+28, wh+27);

}*/