﻿ function red(url)
{
    document.location=url;
}
function load()
{
    var menutd1 = document.getElementById('Menutd1');
    var menutd2 = document.getElementById('Menutd2');
    var menutd3 = document.getElementById('Menutd3');
    var menutd4 = document.getElementById('Menutd4');
    var menutd5 = document.getElementById('Menutd5');
    var menutd6 = document.getElementById('Menutd6');
    //var menutd7 = document.getElementById('Menutd7');
    menutd1.className="menutd1";
    menutd2.className="menutd2";
    menutd3.className="menutd3";
    menutd4.className="menutd4";
    menutd5.className="menutd5";
    menutd6.className="menutd6";
    //menutd7.className="menutd7";
    var k=-1;
    var loc = window.location.href;
    if(loc.indexOf("bussinesNews.aspx")!=-1)
    {
        k=1;
    }
    if(loc.indexOf("firm.aspx")!=-1)
    {
        k=2;
    }
    if(loc.indexOf("tenders.aspx")!=-1)
    {
        k=3;
    }
    if(loc.indexOf("investicion.aspx")!=-1)
    {
        k=4;
    }
    if(loc.indexOf("grantes.aspx")!=-1)
    {
        k=5;
    }
    if(loc.indexOf("index.aspx")!=-1)
    {
        k=6;
    }
    switch (k)
    {
        case 1: menutd2.className="menutd2_sel"; break;
        case 2: menutd3.className="menutd3_sel"; break;
        case 3: menutd4.className="menutd4_sel"; break;
        case 4: menutd5.className="menutd5_sel"; break;
        case 5: menutd6.className="menutd6_sel"; break;
        case 6: menutd1.className="menutd1_sel"; break;
        case -1:break;
        //default: menutd1.className="menutd1_sel";
    }
}
function tema_loader(div_id,tema)
{
    var loc = window.location.href;
    var div = document.getElementById(div_id);
    
    var str = "tema="+tema;
    if(loc.indexOf(str)!=-1)
    {
        div.className="tema_sel";
    }
    else
    {
        div.className="tema"
    }
}
function hide(div_id)
{
    var loc = window.location.href;
    loc =loc.toLowerCase();
    if(loc.indexOf("firms_cat.aspx")!=-1||loc.indexOf("firm.aspx")!=-1)
    {
        document.getElementById(div_id).style.display='block';
    }
    else
    {
        document.getElementById(div_id).style.display='none';
    }
}
function CallPrint(strid,title)
{
     var prtContent = document.getElementById(strid);
     var prttitle = document.getElementById(title);
     var WinPrint = window.open('','','letf=0,top=0,width=750,height=350,toolbar=0,scrollbars=0,status=0');
     WinPrint.document.write(prttitle.innerHTML +"<br>"+ prtContent.innerHTML+"<br>"+"<center>Business.info.ge</center>");
     WinPrint.document.close();
     WinPrint.focus();
     WinPrint.print();
     WinPrint.close();
}
function mailclick()
{
    var key =false;
    var lb = document.getElementById("ctl00_ContentPlaceHolder1_ErrorLabel");
    var txt = document.getElementById("ctl00_ContentPlaceHolder1_MailTextBox");
    
    for(var i=1;i<7;i++)
    {
        if(document.getElementById("ctl00_ContentPlaceHolder1_CheckBox"+i).checked)
        {
            key=true;
            break;
        }
    }
    if(txt.value.indexOf('@')==-1 || txt.value.indexOf('.')==-1)
    {
        lb.text="ელ-ფოსტა არასწორადაა მითითებული";
        return false;
    }
    if(!key)
    {
        lb.text="მონიშნეთ თემა";
        return false;
    }
    
    return true;
}