function openPhoto(img_path){	

	img_alt='';

	var str, StrBody;

	str = 'resizable=yes,width=200,height=200,screenX=200,screenY=200,left=50,top=50';
	
	if (document.all){ 
		StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White" onblur="self.window.close();">';
	} else {
		StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White" onblur="self.window.close();">';
	}
		
	var win_op = window.open('','show', str);
	win_op.document.open();
	win_op.document.writeln('<html>');
	win_op.document.writeln('<head>');
	win_op.document.writeln('<title>' + del_str('<br>',' ',img_alt) + '</title>');
	win_op.document.writeln('<script>');
	win_op.document.writeln('function resize_img() {');
	win_op.document.writeln('var width = document.image.width;');
	win_op.document.writeln('var height = document.image.height;');
	win_op.document.writeln('if (!(document.all)){ self.resizeTo(width,height); } else { self.resizeTo((width+12),(height + 50));');
	win_op.document.writeln(' }');
	win_op.document.writeln('}');
	win_op.document.writeln('</script>');	
	win_op.document.writeln('</head>');
	win_op.document.writeln(StrBody);
	win_op.document.writeln('<img name="image" src='+ img_path + ' border=0 alt="' + del_str('<br>',' ',img_alt) + '" onload="resize_img();">');
	win_op.document.writeln('</body>');
	win_op.document.writeln('</html>');		
	win_op.document.close();
}
function del_str( del, rep , str  ){
	res = str;

	while( res.search(del) >= 0  ){
		res = res.replace( del, rep );
	}

	return res;
}
function openNews(whichOne, lan){
	str = 'resizable=no,width=260,height=377,screenX=200,screenY=200,left=50,top=50';
	var win_op = window.open('http://www.rudkovskaya.ru/'+lan+'/news.php?n='+whichOne,'news', str);
}
function openPopup(p1, p2, lan){
	str = 'resizable=no,width=260,height=377,screenX=200,screenY=200,left=50,top=50';
	var win_op = window.open('http://www.rudkovskaya.ru/'+lan+'/style.php?p1='+p1+'&p2='+p2,'style', str);
}
function getURL(p1, p2){
	if(!p2){
		window.open(p1);
	}else{
		if(p1=='8'){
			var win_op = window.open('media.php?p1='+p1+'&p2='+p2,'media');
		}else if(p1=='4'){
			openPopup(p1, p2);
		}else if(p1=='9'){
			if(p2==1){
				window.open('http://www.rudkovskaya.ru/');
			}else if(p2==2){
				window.open('http://www.bilandima.ru/dnyana/index.html');
			}else if(p2==3){
				window.open('http://www.rudkovskaya.ru/book/');
			}else if(p2==4){
				window.open('http://www.rudkovskaya.ru/forum/');
			}
		}
	}
}
