var ret;
if(!Array.prototype.push){Array.prototype.push=function(obj){for(var i=0;i<arguments.length;i++){this[this.length]=arguments[i];}
return this.length;}}
if(!Array.prototype.shift){Array.prototype.shift=function(){var result=this[0];for(var i=0;i<this.length-1;i++){this[i]=this[i+1];}
this.length--;return result;}}
if(!Array.prototype.unshift){Array.prototype.unshift=function(){this.reverse();for(var i=arguments.length-1;i>=0;i--){this[this.length]=arguments[i]}
this.reverse();return this.length;}}
if(!Array.prototype.pop){Array.prototype.pop=function(){lastElement=this[this.length-1];this.length=Math.max(this.length-1,0);return lastElement;}}
Object.extend=function(destination,source){for(property in source){destination[property]=source[property];}
return destination;}
function $(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=='string')
element=document.getElementById(element);if(arguments.length==1)
return element;elements.push(element);}
return elements;}
function getElementsByClassName(strClass,strTag,objContElm){strTag=strTag||"*";objContElm=objContElm||document;var objColl=(strTag=='*'&&document.all)?document.all:objContElm.getElementsByTagName(strTag);var arr=new Array();var delim=strClass.indexOf('|')!=-1?'|':' ';var arrClass=strClass.split(delim);for(i=0,j=objColl.length;i<j;i++){var arrObjClass=objColl[i].className.split(' ');if(delim==' '&&arrClass.length>arrObjClass.length)continue;var c=0;comparisonLoop:for(k=0,l=arrObjClass.length;k<l;k++){for(m=0,n=arrClass.length;m<n;m++){if(arrClass[m]==arrObjClass[k])c++;if((delim=='|'&&c==1)||(delim==' '&&c==arrClass.length)){arr.push(objColl[i]);break comparisonLoop;}}}}
return arr;}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
function addEvent(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}
else if(elm.attachEvent){var r=elm.attachEvent('on'+evType,fn);EventCache.add(elm,evType,fn);return r;}
else{elm['on'+evType]=fn;}}
var EventCache=function(){var listEvents=[];return{listEvents:listEvents,add:function(node,sEventName,fHandler,bCapture){listEvents.push(arguments);},flush:function(){var i,item;for(i=listEvents.length-1;i>=0;i=i-1){item=listEvents[i];if(item[0].removeEventListener){item[0].removeEventListener(item[1],item[2],item[3]);};if(item[1].substring(0,2)!="on"){item[1]="on"+item[1];};if(item[0].detachEvent){item[0].detachEvent(item[1],item[2]);};item[0][item[1]]=null;};}};}();addEvent(window,'unload',EventCache.flush,false);
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,'scrollbars=0,width=920,height=700,');
}
function MM_openBrWindowEx(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function UrlExists(pURL)
{
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
//alert(xmlhttp);
//alert(pURL);
var rrr;
xmlhttp.open("HEAD", pURL,true);
 xmlhttp.onreadystatechange=function() {
	//alert(xmlhttp.readyState);
	//alert(xmlhttp.status);
	
  if (xmlhttp.readyState==4) {
   if (xmlhttp.status==200) ret=true
    else if (xmlhttp.status==404) ret=false
     else ret=false;
  }
 }
 xmlhttp.send(null);
 //alert('ret='+ret);
 //alert(rrr);
 return ret;
}
function MM_SetImage(iURL,pTitle,pDesc) //v2.0 A.D.A 13.07.2006
	{
		var po=MM_findObj('photo_out');
		//var y=MM_findObj('photo_out_root');
		po.src=iURL;
		//y.style.background='url('+iURL+') no-repeat';
		//alert(y.style.background);
		//x.refresh;
		var x=document.getElementById('photo_text');
         var y=document.getElementById('photo_out');
		 //alert(y.className);
		
         if (pTitle != '')
         {
             x.innerHTML='<div class="t1">'+pTitle+'</div><div id="t2">'+pDesc+'</div>';
			 x.className='photo_text1';
             //y.style.float='left';
             y.className='photo_out2';
         }
         else
         {
             x.innerHTML='';
			 x.className='photo_text2';
			 y.className='photo_out1';

         }
		
	}
/*function IsImg(iSCR)
{
	var img = new Image();
	img.src = iSCR;
	if (img.width == 0) return false; else return true;
}*/

function showPic (whichpic,pTitle,pDesc) {  //v2.0 A.D.A 13.07.2006
	if (document.getElementById) {
		document.getElementById('photo_out').src = whichpic.href;
		/*if (whichpic.title) {
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
		} else {
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
		}
		*/
		var x=document.getElementById('photo_text');
         var y=document.getElementById('photo_out');
	
         if (pTitle != '')
         {
             x.innerHTML='<div class="t1">'+pTitle+'</div><div id="t2">'+pDesc+'</div>';
			 x.className='photo_text1';
             //y.style.float='left';
             y.className='photo_out2';
         }
         else
         {
             x.innerHTML='';
			 x.className='photo_text2';
			 y.className='photo_out1';

         }
		return false;
	} else {
		return true;
	}
}
function MM_AddImage(imgID,pTitle,pDesc) //v2.0 A.D.A 13.07.2006
{

         var wr='<td><div class="item"><a OnClick="return showPic(this,\''+pTitle+'\',\''+pDesc+'\');" href="/dyn_images/img'+imgID+'" ><img src="/dyn_images/big'+imgID+'"/></a></div></td>';
         document.write(wr);
}
function ShowBigImg(iSCR) { //v1.0 A.D.A 17.07.2006

  now = new Date();
  newWindow=window.open('',now.getTime(),'scrollbars=1,width=1280,height=1024');
  newWindow.document.writeln('<html><head>');
  //newWindow.document.writeln('<title>' + name_str + '</title>');
  newWindow.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">');
  newWindow.document.writeln('</head>');
  newWindow.document.writeln('<body align=center bgcolor="#5c1212" leftmargin="20" topmargin="20" marginwidth="20" marginheight="20">');
  newWindow.document.writeln('<center><a href="javascript:;" OnClick="javascript:window.close();"><img style="border:0px;" src=\''+iSCR+'\' alt="Закрыть"/></a>');
  //newWindow.document.writeln('<table width=' + wdth + ' cellspacing="0" cellpadding="0" border="0">');
  //newWindow.document.writeln('<tr><td>' + img_tag + '</td></tr>');
  //newWindow.document.writeln('</table>');
  newWindow.document.writeln('<BR/><br/><a style="font-size:16px;color:white;" href="javascript:;" OnClick="javascript:window.close();">Закрыть</a></center>');
  newWindow.document.writeln('</body></html>');
}
function ShowBI(hlink) //v1.0 A.D.A 17.07.2006
{
	if (hlink.href=='#') return false;
	ShowBigImg(hlink.href);
	return false;
}
