var isIE6 = false;
var fname='';


function myOnload() {

// reduce image flicker in IE6
 if (isIE6) {
   try {
     document.execCommand('BackgroundImageCache', false, true);
   } 
   catch(e) {}; // ignore it
 }

 timeBox = document.getElementById("datetime");
 startclock(); 
 var TimerOne=window.setTimeout;

 loadFlash();
}



function clean(a, id, idfocus){
 if (!id) { var p=a.previousSibling; } 
 else { var p = document.getElementById(id);}
 if(p){ 
   a.onblur=function(){ if(!a.value){ p.style.top=""; } };
   p.style.top="-9999px";
 }
 if (idfocus) {
  p=document.getElementById(idfocus);
  if(p) p.focus();
 }
}


function setSearchText(id,obj_){
 var obj= document.getElementById(id);
 if (!obj) return;
 clean(obj);
 obj.value = obj_.innerHTML;
}



function overOut(obj, isOver){

// if (!isIE6) return;
 while (obj.tagName!='LI' && obj.tagName!='BODY'){
  obj=obj.parentNode;
 }
 if (obj.tagName!='LI') return;

 var liCss = obj.className; //.parentNode.parentNode.className;

 if (isOver) { liCss = liCss.replace('_item', '_over'); }
 else { liCss = liCss.replace('_over', '_item'); }

 obj.className = liCss;
}


function test() { return false;}

document.ondragstart = test;
//запрет на перетаскивание
document.onselectstart = test;
//запрет на выделение элементов страницы
document.oncontextmenu = test;
//запрет на выведение контекстного меню
document.oncopy=test;

if((document.layers||(window.captureEvents)) && location.pathname !="/contact.html") { 
  document.captureEvents(Event.MOUSEDOWN); 
  document.onmousedown=test; 
//  self.blur(); 
 }

window.onload = myOnload;


function zoomFotoShow(fileName){
  window.open(fileName,'_blank','width=320,height=320,left=70,top=50,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes');
}

var tmShowLine = null;

function loadedLine(){
 tmShowLine = setTimeout("showLine()",4000);
}

function showLine(){
 var objD = document.getElementById('logo_line');
 if (!objD) return;
 objD.style.visibility ='visible';
}


var timerID = null;
var timerRunning = false;
var timeBox = null; 

function stopclock(){
 if(timerRunning) clearTimeout(timerID);
 timerRunning = false;
}

function showtime(){
 if (!timeBox) return;
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var month = now.getMonth() + 1;
var day = now.getDate();
var year = now.getYear();
if (year < 1000) year+=1900;

var timeValue = hours;
 timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
 timeValue += "&nbsp;&nbsp;&nbsp;";

 timeValue += ((day < 10) ? "0" : "") + day;
 timeValue += ((month < 10) ? ".0" : ".") + month;
 timeValue += "." + year;

 timeBox.innerHTML = timeValue;
 timerID = setTimeout("showtime()",1000);
 timerRunning = true;
}

function startclock(){
 stopclock();
 showtime();
}

var strStar = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="75" height="75" id="logo_flash"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/star.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="/star.swf" menu="false" quality="high" wmode="transparent" width="75" height="75" name="logo_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

var strLeftBnr =  '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="116" id="lbn_flash"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://nozdrya-mishonov.ru/ugo_banner.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="opaque" /><param name="scale" value="noscale" /><embed src="http://nozdrya-mishonov.ru/ugo_banner.swf" menu="false" quality="high" wmode="opaque" width="100%" height="116" name="lbn_flash" align="middle" allowScriptAccess="always" scale="noscale" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

var strRightBnr = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="116" id="rbn_flash"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://nozdrya-mishonov.ru/right_bnr.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="opaque" /><param name="scale" value="noscale" /><embed src="http://nozdrya-mishonov.ru/right_bnr.swf" menu="false" quality="high" wmode="opaque" width="100%" height="116" name="rbn_flash" align="middle" allowScriptAccess="always" scale="noscale" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

function loadFlash() {

 var objLogoFlashBox = document.getElementById('flashstar');
 if (objLogoFlashBox) {
     objLogoFlashBox.innerHTML = strStar; 
 }

 objLogoFlashBox = document.getElementById('flashstari');
 if (objLogoFlashBox) {
     objLogoFlashBox.innerHTML = strStar; 
 }
 objLogoFlashBox = document.getElementById('phonestar');
 if (objLogoFlashBox) {
     objLogoFlashBox.innerHTML = strStar; 
 }

 objLogoFlashBox = document.getElementById('left_bnr');
 if (objLogoFlashBox) {
     objLogoFlashBox.innerHTML = strLeftBnr;
 }
 objLogoFlashBox = document.getElementById('right_bnr');
 if (objLogoFlashBox) {
     objLogoFlashBox.innerHTML = strRightBnr; 
 }

}

 function more_text() {
 var mainId='main_dop', dspl=document.getElementById(mainId).style.display;
   document.getElementById(mainId).style.display=(dspl=='block'?'none':'block'); 
   //this.src=(document.getElementById('main_dop').style.display=='block' ? 'img/btn_more.gif':'img/btn_more.gif')
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{

 if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); }
 popUpWin = open(URLStr, 'popUpWinS', 'toolbar=no,location=no,directories=no,titlebar=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
 popUpWin.focus();
}