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 ToggleBlock(targObj,imgObj){
	var folder = document.getElementById(targObj).style;
	var img = document.getElementById(imgObj);
	if (folder.display==""){
		folder.display="none"
		try{
			img.src ="/images/arw-rite.gif";
		}catch(e){};
	}else if (folder.display=="none"){
		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();
}

function open_win_size(lnk,w,h){
	x=screen.width/2-w/2;
	y=screen.height/2-h/2;
	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=auto, resisable=no");
	nuWin.focus();
}


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 changePic(pic,source,big_pic){
	ShowWait();
	var img=document.getElementById(pic);
	img.src=source;
	img.onload=function(){
		HideWait();
		if(big_pic){
			img.style.cursor="pointer";
			img.onclick=function(){
				changePic2("large_image2", big_pic, "detailDiv2");
			}
		}else{
			img.style.cursor="default";
			img.onclick=null;
		}
	}
	
}

function ShowWait(){
	var wait=document.getElementById('wait');
	wait.style.display="block";
}
function HideWait(){
	var wait=document.getElementById('wait');
	wait.style.display="none";
}

function changePic2(pic,source, container){
	var img=document.getElementById(pic);
	img.src=source;
	img.onload=function(){
		document.getElementById(container).style.display="block";
	}
	document.getElementById(container).onclick=function(){document.getElementById(container).style.display="none"; document.getElementById('detailText').style.display="none";}
}

function showNewsDetail(detailTextContainer){
	changePic2('large_image2', '/images/blank-666-518.gif', 'detailDiv2');
	cont = document.getElementById('detailText');
	cont.innerHTML = document.getElementById(detailTextContainer).innerHTML;
	cont.style.display = "block";
}
