function tr(obj){
s=obj.value;
re=/^\s+/;s=s.replace(re, '');
re=/\s+$/;s=s.replace(re, '');
obj.value=s;return s;
}
function ve(e){
ind=e.indexOf('\@');return (ind>0 && ind<s.length-1?true:false);
}
function validate(f){
p='Ââåäèòå ';
if (tr(f.email)==''||!ve(f.email.value)) {alert(p+'ïðàâèëüíûé email!'); return false;}
return true;
}

function setdiv(div, HTML) {
	if(document.all) {document.all(div).innerHTML = HTML}

	else if(document.layers) {
		with(document.layers[div].document) {
			open ("text/html")
			write (HTML)
			close ()
		}
	}
	else if(document.getElementById) {document.getElementById(div).innerHTML = HTML;}

}

function cbg(src,color)
{
src.style.backgroundColor=color;
src.style.cursor='hand';
}
function wre(url,txt) {
if (!txt) txt=unescape(url);
document.write('<a href="mailto:'+unescape(url)+'">'+txt+'<\/a>')
}


function nWin(theURL,winName,width,height,features,br) {
var window_width = width+20;
var window_height = height+20;
var newfeatures= features;
var window_top = (screen.height-window_height)/2;
var window_left = (screen.width-window_width)/2;
str='width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ',' + newfeatures + '';
newWindow=window.open('','',str);
newWindow.document.open();

str="<html><head><title>" + winName + "</title></head><body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 rightmargin=0 bgcolor=#ffffff>"+
(br>0?"<br>":"")+'<img src='+theURL+' width='+width+' height='+height+' border=0 hspace=10 vspace=10>'+
"</body></html>";
newWindow.document.write(str);
newWindow.document.close();
}
