function showBigPic(id,widt,heit,type,bro,isback){
if (window.big_item){big_item.close();}
if (bro==0){hei=((screen.height-heit)/2-30);wid=((screen.width-widt)/2);big_item=window.open("/showpic/"+id+"/"+type+"/"+isback+"/","mapp","width="+(widt-4)+",height="+(heit-4)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==1){widt=widt+8;heit=heit+8;hei=((screen.height-heit)/4);wid=((screen.width-widt)/2);big_item=window.open("/showpic/"+id+"/"+type+"/"+isback+"/","mapp","width="+(widt-8)+",height="+(heit-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}

function showCont(id,widt,heit,bro){
if (window.big_item){big_item.close();}
if (bro==0){hei=((screen.height-heit)/2-30);wid=((screen.width-widt)/2);big_item=window.open("/showcont/"+id+"/","mapp","width="+(widt-4)+",height="+(heit-4)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==1){widt=widt+8;heit=heit+8;hei=((screen.height-heit)/4);wid=((screen.width-widt)/2);big_item=window.open("/showcont/"+id+"/","mapp","width="+(widt-8)+",height="+(heit-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}

function showNews(id,widt,heit,bro){
if (window.big_item){big_item.close();}
if (bro==0){hei=((screen.height-heit)/2-30);wid=((screen.width-widt)/2);big_item=window.open("/shownews/"+id+"/","mapp","width="+(widt-4)+",height="+(heit-4)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==1){widt=widt+8;heit=heit+8;hei=((screen.height-heit)/4);wid=((screen.width-widt)/2);big_item=window.open("/shownews/"+id+"/","mapp","width="+(widt-8)+",height="+(heit-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}

function ChangeFoto(n,bro){
if (n==1){if (Counter<(pics.length-1)){Counter++;}}
if (n==2){if (Counter>0){Counter--;}}
document.all["foto"].src="/download/"+pics[Counter];
btns = document.getElementsByName('fotolenta'); 
if (Counter<(pics.length-1)){
document.all["fforward"].innerHTML='<img src=/img/active.jpg width=13 height=15 alt="Следующее фото" style="cursor:hand;cursor:pointer;" onclick=ChangeFoto(1,'+bro+');>';
}
else{
document.all["fforward"].innerHTML='<img src=/img/dead2.jpg width=13 height=15>';
}
if (Counter>0){
document.all["fback"].innerHTML='<img src=/img/active2.jpg width=13 height=15 alt="Предыдущее фото" style="cursor:hand;cursor:pointer;" onclick=ChangeFoto(2,'+bro+');>';
}
else{
document.all["fback"].innerHTML='<img src=/img/dead.jpg width=13 height=15>';
}
if(pics_b[Counter]!=""){
document.all["zoom"].innerHTML='<img src=/img/zoom.jpg width=22 height=25 alt="Увеличить изображение" border=0 style="cursor:hand;cursor:pointer;" onclick=ShowFoto('+bro+');>';
}
else{document.all["zoom"].innerHTML='';}
document.all["ftext"].innerHTML=texts[Counter];
}


function AutoChangeFoto(n,bro){
if (pics.length>1){
if (n==1){if (Counter<(pics.length-1)){Counter++;}}
if (Counter==(pics.length-1)){Counter=0;}
if (n==2){if (Counter>0){Counter--;}}
if (navigator.appName == "Microsoft Internet Explorer"){
foto.style.filter="blendTrans(duration=2)";
foto.style.filter="blendTrans(duration=crossFadeDuration)";
foto.filters.blendTrans.Apply();
foto.filters.blendTrans.Play();
}
document.all["foto"].src="/download/"+pics[Counter];
btns = document.getElementsByName('fotolenta'); 
if (Counter<(pics.length-1)){
document.all["fforward"].innerHTML='<img src=/img/active.jpg width=13 height=15 alt="Следующее фото" style="cursor:hand;cursor:pointer;" onclick=ChangeFoto(1,'+bro+');>';
}
else{
document.all["fforward"].innerHTML='<img src=/img/dead2.jpg width=13 height=15>';
}
if (Counter>0){
document.all["fback"].innerHTML='<img src=/img/active2.jpg width=13 height=15 alt="Предыдущее фото" style="cursor:hand;cursor:pointer;" onclick=ChangeFoto(2,'+bro+');>';
}
else{
document.all["fback"].innerHTML='<img src=/img/dead.jpg width=13 height=15>';
}
if(pics_b[Counter]!=""){
document.all["zoom"].innerHTML='<img src=/img/zoom.jpg width=22 height=25 alt="Увеличить изображение" border=0 style="cursor:hand;cursor:pointer;" onclick=ShowFoto('+bro+');>';
}
else{document.all["zoom"].innerHTML='';}
if(document.getElementById('ftext')){
document.all["ftext"].innerHTML=texts[Counter];
}
setTimeout("AutoChangeFoto(1,"+bro+")",3500);
}
}


function getFotos(n,bro){
if(document.getElementById('foto')){
setTimeout("AutoChangeFoto(1,"+bro+")",3500);
}
}

function ChangeFoto2(n,bro){
if (n==1){if (Counter<(pics.length-1)){Counter++;}}
if (n==2){if (Counter>0){Counter--;}}
document.all["foto"].src="/download/"+pics[Counter];
btns = document.getElementsByName('fotolenta'); 
if (Counter<(pics.length-1)){
document.all["fforward"].innerHTML='<img src=/img/active.jpg width=13 height=15 alt="Следующее фото" style="cursor:hand;cursor:pointer;" onclick=ChangeFoto2(1,'+bro+');>';
}
else{
document.all["fforward"].innerHTML='<img src=/img/dead2.jpg width=13 height=15>';
}
if (Counter>0){
document.all["fback"].innerHTML='<img src=/img/active2.jpg width=13 height=15 alt="Предыдущее фото" style="cursor:hand;cursor:pointer;" onclick=ChangeFoto2(2,'+bro+');>';
}
else{
document.all["fback"].innerHTML='<img src=/img/dead.jpg width=13 height=15>';
}
if(pics_b[Counter]!=""){
document.all["zoom"].innerHTML='<img src=/img/zoom.jpg width=22 height=25 alt="Увеличить изображение" border=0 style="cursor:hand;cursor:pointer;" onclick=ShowFoto('+bro+');>';
}
else{document.all["zoom"].innerHTML='';}
}


function ChangeFoto2_(n,bro){
if (n==1){if (Counter_<(pics_.length-1)){Counter_++;}}
if (n==2){if (Counter_>0){Counter_--;}}
document.all["foto_"].src="/download/"+pics_[Counter_];
btns = document.getElementsByName('fotolenta_'); 
if (Counter_<(pics_.length-1)){
document.all["fforward_"].innerHTML='<img src=/img/active.jpg width=13 height=15 alt="Следующее фото" style="cursor:hand;cursor:pointer;" onclick=ChangeFoto2_(1,'+bro+');>';
}
else{
document.all["fforward_"].innerHTML='<img src=/img/dead2.jpg width=13 height=15>';
}
if (Counter_>0){
document.all["fback_"].innerHTML='<img src=/img/active2.jpg width=13 height=15 alt="Предыдущее фото" style="cursor:hand;cursor:pointer;" onclick=ChangeFoto2_(2,'+bro+');>';
}
else{
document.all["fback_"].innerHTML='<img src=/img/dead.jpg width=13 height=15>';
}
if(pics_b_[Counter_]!=""){
document.all["zoom_"].innerHTML='<img src=/img/zoom.jpg width=22 height=25 alt="Увеличить изображение" border=0 style="cursor:hand;cursor:pointer;" onclick=ShowFoto_('+bro+');>';
}
else{document.all["zoom_"].innerHTML='';}
}

function ShowFoto(bro){
xp=xx_b[Counter]/2;
yp=yy_b[Counter]/2;
if (bro==0){hei=(screen.height/2-yp);wid=(screen.width/2-xp);big_item=window.open("/showfoto/"+pics_b[Counter]+"/","mapp","width="+(xx_b[Counter]-4)+",height="+(yy_b[Counter]-4)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==1){hei=(screen.height/2-yp);wid=(screen.width/2-xp);big_item=window.open("/showfoto/"+pics_b[Counter]+"/","mapp","width="+xx_b[Counter]+",height="+yy_b[Counter]+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}

function ShowFoto_(bro){
xp=xx_b[Counter_]/2;
yp=yy_b[Counter_]/2;
if (bro==0){hei=(screen.height/2-yp);wid=(screen.width/2-xp);big_item=window.open("/showfoto/"+pics_b_[Counter_]+"/","mapp","width="+(xx_b_[Counter_]-4)+",height="+(yy_b_[Counter_]-4)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==1){hei=(screen.height/2-yp);wid=(screen.width/2-xp);big_item=window.open("/showfoto/"+pics_b_[Counter_]+"/","mapp","width="+xx_b_[Counter_]+",height="+yy_b_[Counter_]+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}


function ShowFotoX(id,widt,heit,bro){
if (window.big_item){big_item.close();}
if (bro==0){hei=((screen.height-heit)/2-30);wid=((screen.width-widt)/2);big_item=window.open("/showfotox/"+id+"/","mapp","width="+(widt-4)+",height="+(heit-4)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==1){widt=widt+8;heit=heit+8;hei=((screen.height-heit)/4);wid=((screen.width-widt)/2);big_item=window.open("/showfotox/"+id+"/","mapp","width="+(widt-8)+",height="+(heit-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}

function checkForm() {
if (document.sendtz.f1.value=='') {
alert('Не указано название предприятия.');
location.href="#name";
return false;
}
document.sendtz.submit();
}

function quit(){
alert(1);
}

function closewindow(){
document.getElementById("newyear").className="shownone";
}


function changeTdHeight(){
if (document.getElementById("thistd").height<222){
if (document.getElementById("thistd").height<201){
document.getElementById("thistd").style.display="block";
var h=parseInt(document.getElementById("thistd").height)+20;
document.getElementById("thistd").height=h;
setTimeout("changeTdHeight()",1);
}
else{
var h=parseInt(document.getElementById("thistd").height)+10;
document.getElementById("thistd").height=h;
document.getElementById("thistd2").style.display="block";
}
}
}

function changeTdHeightBack(){
if (document.getElementById("thistd").height>20){
document.getElementById("thistd").style.display="block";
var h=parseInt(document.getElementById("thistd").height)-20;
document.getElementById("thistd").height=h;
setTimeout("changeTdHeightBack()",1);
}
else{
document.getElementById("thistd").style.display="none";
}
}