// chamosashleli meniu daicyo

function gachena(obieqti)
{
gamkrali=document.getElementById(obieqti);
setTimeout("gamkrali.style.display='block'", 200);
}

function gakroba(obieqti)
{
gachenili=document.getElementById(obieqti);
setTimeout("gachenili.style.display='none'", 200);
}

// chamosashleli meniu damtavrda

// ganvadebis gamotvla daicyo

function avtogamotvla()
{
xx=document.ganvadebis_forma.girebuleba.value;
orm=xx*40;
proc=orm/100;
document.ganvadebis_forma.shenatani.value=proc;
}

function gamotvla()
{
x=document.ganvadebis_forma.girebuleba.value;
y=document.ganvadebis_forma.shenatani.value;
z=document.ganvadebis_forma.vada[document.ganvadebis_forma.vada.selectedIndex].value;

ss = (x-y)/z;
bb = x-y;
cc = (bb*15)/100;
ff = cc/z;
sh = ss+ff;

var browserName=navigator.appName;

if(browserName=="Microsoft Internet Explorer")
{
if(document.layers)
{
document.getElementById('rezultati').open();
document.getElementById('rezultati').write("<font color='#b41212'>ყოველთვიური გადასახადი:</font> "+Math.ceil(sh)+" ლარი");	
document.getElementById('rezultati').close();
}
else
{
document.all['rezultati'].innerHTML = "<font color='#b41212'>ყოველთვიური გადასახადი:</font> "+Math.ceil(sh)+" ლარი";
}
}
else
{
alert("ყოველთვიური გადასახადი: "+Math.ceil(sh)+" ლარი");
}
}

// ganvadebis gamotvla damtavrda

// registraciis formis dacva daicyo

function amoshla()
{
document.forma.georgiankb.checked=false;
}

function org_shemocmeba()
{

if(document.forma.org_user.value == "")
{
document.forma.org_user.style.backgroundColor = "#3399CC";
document.forma.org_user.focus();
return false;
}

if(document.forma.org_pass1.value == "")
{
document.forma.org_pass1.style.backgroundColor = "#3399CC";
document.forma.org_pass1.focus();
return false;
}

if(document.forma.org_pass2.value == "")
{
document.forma.org_pass2.style.backgroundColor = "#3399CC";
document.forma.org_pass2.focus();
return false;
}

if((document.forma.org_mail.value == "") || (document.forma.org_mail.value.indexOf('@') == -1) || (document.forma.org_mail.value.indexOf('.') == -1))
{
document.forma.org_mail.style.backgroundColor = "#3399CC";
document.forma.org_mail.focus();
return false;
}
}

function fiz_shemocmeba()
{

if(document.forma.fiz_user.value == "")
{
document.forma.fiz_user.style.backgroundColor = "#3399CC";
document.forma.fiz_user.focus();
return false;
}

if(document.forma.fiz_pass1.value == "")
{
document.forma.fiz_pass1.style.backgroundColor = "#3399CC";
document.forma.fiz_pass1.focus();
return false;
}

if(document.forma.fiz_pass2.value == "")
{
document.forma.fiz_pass2.style.backgroundColor = "#3399CC";
document.forma.fiz_pass2.focus();
return false;
}

if((document.forma.fiz_mail.value == "") || (document.forma.fiz_mail.value.indexOf('@') == -1) || (document.forma.fiz_mail.value.indexOf('.') == -1))
{
document.forma.fiz_mail.style.backgroundColor = "#3399CC";
document.forma.fiz_mail.focus();
return false;
}
}

// registraciis formis dacva damtavrda

// samartlebrivi formebis gachena-damalva daicyo

window.onload = chatvirtva;

function chatvirtva()
{
dam_live=document.getElementById("hidden_library");
}

function law_hidden()
{
if(dam_live.style.display=="none")
{
dam_live.style.display="block";
}
else
{
dam_live.style.display="none";
}
}

// samartlebrivi formebis gachena-damalva damtavrda

function go()
{
// a cvladi aris patara panjris gaxsnis cvladi
	var a = window.open('','','width=430,height=330');

// mititebulia, rom amoibechdos teqsti konkretuli adgilidan
	a.document.open("text/html");

// mititebulia, rom aigos id im obieqtidan (dividan) romelic ibechdeba
	a.document.write(document.getElementById('autoregi').innerHTML);

// divi cakitxulia da ixureba panjara
	a.document.close();

// ibechdeba
	a.print();
}
