﻿//Script Document
function blurSearchString(elem, textv){
  search = document.getElementById(elem);
  if (search.value==''){
   search.value = textv; 
  }
}

function focusSearchString(elem, textv){
  search = document.getElementById(elem);
  if (search.value==textv){
   search.value = ''; 
  }
}
function setCookie (name, value, expires, path, domain, secure) {
      document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}
function write_bg() {
	scrs_l = 4;
	scrnum = getCookie("scrnum");
	if (!scrnum || scrnum>scrs_l-1){ 
		scrnum = 1;
 	} else {
		scrnum++;	
	}
	document.write("<div class='ppl' style='background:url(images/l"+scrnum+".gif) top left no-repeat;' >");
	document.write("<div class='ppl' style='background:url(images/r"+scrnum+".gif) top right no-repeat;' >");
	setCookie ("scrnum", scrnum)
}
function write_end() {
	document.write("</div></div>");
}
function opwin(picname,pictext,s)
{
	win= window.open('','window_name','width=300,height=400,resizable=yes,scrollbars=yes')
	o = win.document
	o.writeln('<html>')
	o.writeln('<head>')
	o.writeln('<title>Игорь Лекомцев</title>')

	o.writeln('<script language=\'javascript\' type=\'text/javascript\'>') 
	o.writeln('var arrTemp=self.location.href.split(\'?\');') 
	o.writeln('var picUrl = (arrTemp.length>0)?arrTemp[1]:\'\';') 
	o.writeln('var NS = (navigator.appName==\'Netscape\')?true:false;') 
	o.writeln('function FitPic() {')
	o.writeln('iWidth = document.images[0].width;')
	o.writeln('iHeight = document.images[0].height;')
	if(s=='no') {o.writeln('self.resizeTo(800, 600);')} else {o.writeln('self.resizeTo(iWidth + 200, iHeight + 300);')}
	o.writeln('};')
	o.writeln('</script>')
	o.writeln('<link href="main.css" rel="stylesheet" type="text/css">')
	o.writeln('</head>')
	o.writeln('<body  style="padding:20px" onload=\'FitPic();\'>')
	o.writeln('<center>')
	o.writeln('<table border=0 cellspacing=0 cellpadding=0  style="margin-top:100px">')
	o.writeln('<tr>')
	o.writeln('<td>')
	o.writeln('<img src='+picname+'>')
	o.writeln('<p>'+pictext+'</p>')
	o.writeln('</td>')
	o.writeln('</tr>')
	o.writeln('</table>')
 o.writeln('</center>')

	o.writeln('</body>')
	o.writeln('</html>')

	o.close()
	win.focus()
	return false;
}