var popupW=860;
var popupH=660;
var pollImageSelected;
var pollTitleSelected;
var normalTextColor="#5d5f61";
var normalImageBorderColor="#000000";
var highlightedColor="#cb1f1f";
var ns6=document.getElementById&&!document.all?1:0
var head="display:''"
var folder=''
var selObj='';

function PlaceLogo(){
	if (window.name && history.length<2){
		document.write('<a href="javascript:window.close()" title="закрыть"><img src="/images/m02.gif" border="0"></a>');
	}else if(history.length>1){
		document.write('<a href="javascript:history.back()" title="назад"><img src="/images/m02.gif" border="0"></a>');
	}else{
		document.write('<a href="/" title="на главную"><img src="/images/m02.gif" border="0"></a>');
	}
}

function ToggleBlock(targObj,imgObj){
	var folder = document.getElementById(targObj).style;
	var img = document.getElementById(imgObj);
	if (folder.display==""){
		//curobj.className="";
		//curobj.style.color=normalTextColor;
		folder.display="none"
		try{
			img.src ="/images/arw-rite.gif";
		}catch(e){};
	}else if (folder.display=="none"){
		//curobj.className="highlighted";
		//curobj.style.color=highlightedColor;
		folder.display=""
		try{
			img.src="/images/arw-down.gif";
		}catch(e){};
	}
}




function open_win(lnk,dx,dy){
	w=popupW;
	h=popupH;
	x=screen.width/2-w/2+dx;
	y=screen.height/2-h/2+dy;
	win_name="popup_window"+Math.floor(Math.random()*10000);
	nuWin = window.open(lnk, win_name, "width="+w+", height="+h+", left="+x+", top="+y+", status=no, toolbar=no, menubar=no, scrollbars=yes, resisable=no");
	nuWin.focus();
	return false;
}

function PollSelectRadio(id){
	try{
		pollImageSelected.style.border="1px solid "+normalImageBorderColor;
	}catch(e){};
	var radio = document.getElementById(id);
	radio.checked="true";
	var img = document.getElementById('img_'+id);
	img.style.border="1px solid #cb1f1f";
	pollImageSelected = img;
}

function PollSelectImage(id){
	try{
		pollImageSelected.style.border="1px solid "+normalImageBorderColor;
	}catch(e){};
	var img = document.getElementById('img_'+id);
	img.style.border="1px solid "+highlightedColor;
	pollImageSelected = img;
}

function PollResultSelectTitle(id){
	try{
		pollImageSelected.style.border="1px solid "+normalImageBorderColor;
	}catch(e){};
	try{
		pollTitleSelected.style.color=normalTextColor;
	}catch(e){};
	var title = document.getElementById(id);
	title.style.color=highlightedColor;
	var img = document.getElementById('img_'+id);
	img.style.border="1px solid "+highlightedColor;
	pollImageSelected = img;
	pollTitleSelected = title;
}


function show_pic(pic,alt){
k = new Image();
k.scr = pic;
if(alt==null)alt='Фотография';
myWin = window.open("","displayWindow",
               "width="+10+",height="+10+",status=no,toolbar=no,menubar=no");
 myWin.document.write("<html><head><title>"+alt+"</title></head><body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0>");

 myWin.document.write("<img name=tests3 src="+k.scr+" alt='"+alt+"'>");
 myWin.document.write("</body></html>"); 

do{
}
while(!myWin.document.tests3.complete);
wd = myWin.document.tests3.width+10;
ht = myWin.document.tests3.height+20;
myWin.resizeTo(wd,ht);
}

function resize(myWIn) {
wd = myWin.document.tests3.width+10;
ht = myWin.document.tests3.height+20;
myWin.resizeTo(wd,ht);}


function show_text() 
{ 
if (document.all.fr.style.display=='none') 
document.all.fr.style.display='block'; 
else 
document.all.fr.style.display='none'; 
} 


function show_pic(pic,alt){
k = new Image();
k.scr = pic;
if(alt==null)alt='Фотография';
myWin = window.open("","displayWindow",
               "width="+10+",height="+10+",status=no,toolbar=no,menubar=no");
 myWin.document.write("<html><head><title>"+alt+"</title></head><body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0>");

 myWin.document.write("<img name=tests3 src="+k.scr+" alt='"+alt+"'>");
 myWin.document.write("</body></html>"); 

do{
}
while(!myWin.document.tests3.complete);
wd = myWin.document.tests3.width+10;
ht = myWin.document.tests3.height+20;
myWin.resizeTo(wd,ht);
}

function nav_back (){
if (history.length == 0) window.close();
else history.back();
/**window.alert (window.opener.name);
window.alert (history);
window.alert (history[0]);
window.alert (history.current);
if (history.current == history[0])
window.close();
else**/
}

