var param = "copyhistory=no,directories=no,menubar=yes,location=no,resizable=yes,scrollbars=yes";

function window_open(url, name, w, h)
{
    new_window = window.open(url, name, 'width=' + w + ', height=' + h + ", " + param);
    new_window.focus();
}

function change_img_src(img, url)
{
    img.src=url;
}

function mycheck()
{
        len1 = document.form1.info_history.value.length;
        len2 = document.form1.info_services.value.length;
        len3 = document.form1.info_specialization.value.length;
        len4 = document.form1.info_clients.value.length;

        if(len1 + len2 + len3 + len4 < 1001)
        {
            return true;
        }
        else
        {
            alert('Объем информации о компании не должен превышать 1000 знаков (введено '+(len1+len2+len3+len4)+' знаков)');
            return false;
        }
}

function mycheck2()
{
        len1 = document.form1.info_history.value.length;
        len2 = document.form1.info_services.value.length;
        len3 = document.form1.info_specialization.value.length;
        len4 = document.form1.info_clients.value.length;

        if(len1 + len2 + len3 + len4 < 301)
        {
            return true;
        }
        else
        {
            alert('Объем информации о компании не должен превышать 300 знаков (введено'+(len1+len2+len3+len4)+'знаков)');

            return false;
        }
}

function myexpand(what)
{
    document.getElementById(what).style.display="";
}

function mycollapse(what)
{
    document.getElementById(what).style.display="none";
}

 function mytoggle(sshow)

{
    if(document.getElementById(sshow).style.display!='') myexpand(sshow); else mycollapse(sshow);

}

//показывает описание по клику на заголовок
function show_comp(id){

var show=document.getElementById('show'+id);
var desc=document.getElementById('desc'+id);
var close=document.getElementById('close'+id);

if (show.style.display=='block')
{
 show.style.display='none';
 close.style.display='block';
 desc.style.display='block';
}
 else
{
 show.style.display='block';
 close.style.display='none';
 desc.style.display='none';
}
}

