function showAnswer(id,answers,ques){
for (i=1; i<=answers; i++){
if (i==id){
if (eval("answer"+i).className=="isnone"){
eval("answer"+i).className="allnone";
eval("aques"+i).className="allnone";
eval("ques"+i).className="isnone";
}
else{
eval("answer"+i).className="isnone";
eval("aques"+i).className="isnone";
eval("ques"+i).className="allnone";
}
}
else{
eval("answer"+i).className="isnone";
eval("aques"+i).className="isnone";
eval("ques"+i).className="allnone";
}
}
}


function showDescription(id,als){
for (i=0; i<=als; i++){
if (i==id){
if (eval("podrob"+i).className=="isnone"){
eval("podrob"+i).className="allnone";
eval("slink"+i).className="isnone";
}
else{
eval("podrob"+i).className="isnone";
eval("slink"+i).className="allnone";
}
}
}
}

function sortNews(link){
document.location=link+document.getElementById("sort").value+"/";
}

function sortNewsIn(link){
document.location="/"+document.getElementById("sort").value+link;
}


function ShowFoto(id,widt,heit,bro){
if (window.big_item){big_item.close();}
if (bro==1){hei=((screen.height-heit)/2-30);wid=((screen.width-widt)/2);big_item=window.open("/showfoto/"+id+"/","mapp","width="+(widt-4)+",height="+(heit-4)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==0){widt=widt+8;heit=heit+8;hei=((screen.height-heit)/4);wid=((screen.width-widt)/2);big_item=window.open("/showfoto/"+id+"/","mapp","width="+(widt-8)+",height="+(heit-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}

function ShowOur(id,widt,heit,bro){
if (window.big_item){big_item.close();}
if (bro==1){hei=((screen.height-heit)/2-30);wid=((screen.width-widt)/2);big_item=window.open("/showour/"+id+"/","mapp","width="+(widt-4)+",height="+(heit-4)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
if (bro==0){widt=widt+8;heit=heit+8;hei=((screen.height-heit)/4);wid=((screen.width-widt)/2);big_item=window.open("/showour/"+id+"/","mapp","width="+(widt-8)+",height="+(heit-8)+",screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=no");big_item.focus();}
}


function HideReveal(otdel){
var xx=1;
while (xx<11){
if (xx==otdel){eval("doctora"+xx).className="reveal";} else{eval("doctora"+xx).className="hide";}
xx++;
}
}

function filiShow(){
document.getElementById("fili2").style.display = "block";
}

function filiHide(){
document.getElementById("fili2").style.display = "none";
}

function upPages(id){
document.getElementById("cpage"+(id-1)).className = "isnone";
document.getElementById("cpage"+id).className = "allnone";
}

function downPages(id){
document.getElementById("cpage"+(id+1)).className = "isnone";
document.getElementById("cpage"+id).className = "allnone";
}

function setRram(id){
document.getElementById("rram"+id).className = "ram";
}

function unsetRram(id){
document.getElementById("rram"+id).className = "noram";
}

function checkAgree(){
if (document.getElementById("iagree").checked){document.getElementById("sendreg").disabled=false;}
else{document.getElementById("sendreg").disabled=true;}
}

function next5(current){
if (current==5){
for (ii=1;ii<15;ii++){
document.getElementById("therow"+ii).className="isnone"; 
for (jj=0;jj<22;jj++){
document.getElementById("therow"+ii+"a"+jj).className="isnone"; 
}
}
for (ii=6;ii<11;ii++){
document.getElementById("therow"+ii).className="isall"; 
for (jj=0;jj<22;jj++){
document.getElementById("therow"+ii+"a"+jj).className="isall"; 
}
}

document.getElementById("pages").innerHTML='<a onclick=next5(1); style="cursor:hand;cursor:pointer;"><u>предыдущие 5</u></a> | <a onclick=next5(10); style="cursor:hand;cursor:pointer;"><u>следующие 4</u></a>'; 
}

if (current==10){
for (ii=1;ii<15;ii++){
document.getElementById("therow"+ii).className="isnone"; 
for (jj=0;jj<22;jj++){
document.getElementById("therow"+ii+"a"+jj).className="isnone"; 
}
}
for (ii=11;ii<15;ii++){
document.getElementById("therow"+ii).className="isall"; 
for (jj=0;jj<22;jj++){
document.getElementById("therow"+ii+"a"+jj).className="isall"; 
}
}

document.getElementById("pages").innerHTML='<a onclick=next5(5); style="cursor:hand;cursor:pointer;"><u>предыдущие 5</u></a>'; 
}


if (current==1){
for (ii=1;ii<15;ii++){
document.getElementById("therow"+ii).className="isnone"; 
for (jj=0;jj<22;jj++){
document.getElementById("therow"+ii+"a"+jj).className="isnone"; 
}
}

for (ii=1;ii<6;ii++){
document.getElementById("therow"+ii).className="isall"; 
for (jj=0;jj<22;jj++){
document.getElementById("therow"+ii+"a"+jj).className="isall"; 
}
}

document.getElementById("pages").innerHTML='<a onclick=next5(5); style="cursor:hand;cursor:pointer;"><u>следующие 5</u></a>'; 
}




}


function changeBlocks(){
document.getElementById("donthave").className="hide";
document.getElementById("ihave").className="reveal";
document.getElementById("blocktext").innerHTML='<table cellspacing=0 cellpadding=0 border=0><tr><td valign=top><a id=blocklink class=myxlink onmouseover=overLink(); onmouseout=outLink(); onclick=changeBlocksBack();>У меня еще нет личной страницы</a></td></tr><tr><td valign=top style="padding-top:5;"><a href=/ourpages/mypage/mypassword/>Забыли пароль?</a></td></tr></table>';
}

function changeBlocksBack(){
document.getElementById("donthave").className="reveal";
document.getElementById("ihave").className="hide";
document.getElementById("blocktext").innerHTML='<a id=blocklink class=myxlink onmouseover=overLink(); onmouseout=outLink(); onclick=changeBlocks();>У меня уже есть личная страница</a>';
}

function overLink(){
document.getElementById("blocklink").className="myxnlink";
}

function outLink(){
document.getElementById("blocklink").className="myxlink";
}

function checkAddNew(){
if (document.getElementById("thetext").value!="" || document.getElementById("thehead").value!="" || document.getElementById("pic1").value!="" || document.getElementById("pic2").value!="" || document.getElementById("pic3").value!="" || document.getElementById("pic4").value!=""){
document.getElementById("sendnew").disabled=false;
}
else{document.getElementById("sendnew").disabled=true;}
}

function hideText(){
document.getElementById("newyear").className="hide";
this.setCookie("ishide","1");
}

function showTextBox(){
document.getElementById("newyear").className="show";
}

function setCookie (name, value, expire, path)
{
	document.cookie = name + '=' + escape (value)
		+ ((expire == null)? '' : ('; expires=' + expire.toGMTString()))
		+ ((path == null)? '' : ('; path=' + path));
}

function switchSecond(){
document.getElementById("click47").disabled=true;
document.getElementById("click34").disabled=false;
document.getElementById("click35").disabled=false;
document.getElementById("click34").checked=true;
document.getElementById("clicktext47").className="sttx";
document.getElementById("clicktext34").className="mtx";
document.getElementById("clicktext35").className="mtx";
}

function switchFirst(){
document.getElementById("click47").disabled=false;
document.getElementById("click34").disabled=true;
document.getElementById("click35").disabled=true;
document.getElementById("click47").checked=true;
document.getElementById("clicktext47").className="mtx";
document.getElementById("clicktext34").className="sttx";
document.getElementById("clicktext35").className="sttx";
}
