var httpRequest = createHttpRequest();
var result = '';


function sendRequest(file, _result, getRequestProc) {
result = _result;
document.getElementById(result).innerHTML = 'Загрузка... <img src="/loading.gif">';
httpRequest.open('POST', file, true)
httpRequest.onreadystatechange = getRequest;
httpRequest.send(null);
}


function getRequest() {
if (httpRequest.readyState == 4) {
document.getElementById(result).innerHTML = httpRequest.responseText;
}}


var httpRequest1 = createHttpRequest(); var result1 = '';
function sendRequest1(file, _result, getRequestProc) { result1 = _result; document.getElementById(result1).innerHTML = 'Загрузка... <img src="/images/loading.gif">'; httpRequest1.open('POST', file, true); httpRequest1.onreadystatechange = getRequest1; httpRequest1.send(null); } 
function getRequest1() { if (httpRequest1.readyState == 4) { document.getElementById(result1).innerHTML = httpRequest1.responseText; }}

function createHttpRequest()
{
    if (window.XMLHttpRequest) {
        try {
            return new XMLHttpRequest();
        } catch (e){}
    } else if (window.ActiveXObject) {
        try {
            return new ActiveXObject('Msxml2.XMLHTTP');
        } catch (e){
          try {
              return new ActiveXObject('Microsoft.XMLHTTP');
          } catch (e){}
        }
    }
    return null;
}


function checkLength_250(){
        if( document.iblock_add.mess_250.value.length > 250 ){
            document.iblock_add.mess_250.value = document.iblock_add.mess_250.value.substring(0, 250);
        }
        document.iblock_add.mess_lenght_250.value = 250 - document.iblock_add.mess_250.value.length;
}


function checkLength_150(){
        if( document.iblock_add.mess_150.value.length > 150 ){
            document.iblock_add.mess_150.value = document.iblock_add.mess_150.value.substring(0, 150);
        }
        document.iblock_add.mess_lenght_150.value = 150 - document.iblock_add.mess_150.value.length;
}


function checkLength_1000(){
        if( document.iblock_add.mess_1000.value.length > 1000 ){
            document.iblock_add.mess_1000.value = document.iblock_add.mess_1000.value.substring(0, 1000);
        }
        document.iblock_add.mess_lenght_1000.value = 1000 - document.iblock_add.mess_1000.value.length;
}



function check4()
{
    var name_reed = document.getElementById('name');
    var info_reed = document.getElementById('info');
       var pic_file = document.getElementById('pic').value;
	var picrush;
	var reg=/.jpg|.gif|.png|.rar|.zip|pdf|doc/i;
	var result=reg.test(pic_file) ? picrush=1 : picrush=2
    if ((pic_file!='') && (picrush!='1')) {  document.getElementById('pic').value=''; alert ('Формат файла должен быть .jpg .png .gif  .rar  .zip  pdf или doc');  }
    var btn = document.getElementById('btn');
    if ((name_reed.value != '')  && (info_reed.value!= '') ) { btn.disabled = false; } else { btn.disabled = true; }
}


function Incliude_Footer() { 
document.write("<!--Rating@Mail.ru counter-->");
d=document;var a='';a+=';r='+escape(d.referrer);js=10;
a+=';j='+navigator.javaEnabled();js=11;
s=screen;a+=';s='+s.width+'*'+s.height;
a+=';d='+(s.colorDepth?s.colorDepth:s.pixelDepth);js=12;
js=13;
d.write('<a rel="nofollow" href="http://top.mail.ru/jump?from=1637449" target="_top">'+
'<img src="http://dc.cf.b8.a1.top.mail.ru/counter?id=1637449;t=51;js='+js+
a+';rand='+Math.random()+'" alt="Рейтинг@Mail.ru" border="0" '+
'height="31" width="88"><\/a>');if(11<js)d.write('<'+'!-- ');
document.write("<noscript><a target=\"_top\" href=\"http://top.mail.ru/jump?from=1637449\">");
document.write("<img src=\"http://dc.cf.b8.a1.top.mail.ru/counter?js=na;id=1637449;t=51\"");
document.write("height=\"31\" width=\"88\" border=\"0\" alt=\"Рейтинг@Mail.ru\"></a></noscript>");
if(11<js)d.write('--'+'>');
document.write("<!--// Rating@Mail.ru counter-->");
document.write("&nbsp;");
document.write("<!--LiveInternet counter-->");
document.write("<a href='http://www.liveinternet.ru/click' "+
"target=_blank><img src='http://counter.yadro.ru/hit?t41.4;r"+
escape(document.referrer)+((typeof(screen)=="undefined")?"":
";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?
screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
";"+Math.random()+
"' alt='' title='LiveInternet' "+
"border='0' width='31' height='31'><\/a>")
document.write("<!--/LiveInternet-->");
document.write("&nbsp;");
document.write("<!-- begin of Top100 code -->");
document.write("<script id=\"top100Counter\" type=\"text/javascript\" src=\"http://counter.rambler.ru/top100.jcn?2474619\"></script>");
document.write("<noscript>");
document.write("<a href=\"http://top100.rambler.ru/navi/2474619/\" rel=\"nofollow\">");
document.write("<img src=\"http://counter.rambler.ru/top100.cnt?2474619\" alt=\"Rambler's Top100\" border=\"0\" />");
document.write("</a>");
document.write("</noscript>");
document.write("<!-- end of Top100 code -->");
document.write("&nbsp;");
document.write("<!-- Yandex.Metrika -->");
document.write("<script src=\"//mc.yandex.ru/metrika/watch.js\" type=\"text/javascript\"></script>");
document.write("<script type=\"text/javascript\">");
try { var yaCounter572912 = new Ya.Metrika(572912); } catch(e){}
document.write("</script>");
document.write("<noscript><div style=\"position: absolute;\"><img src=\"//mc.yandex.ru/watch/572912\" alt=\"\" /></div></noscript>");
document.write("<!-- /Yandex.Metrika -->");
document.write("</noindex>");
document.write("<a href=\"/rss.php\"><img src=\"/images/rss.gif\" border=\"0\"></a>"); 
}





function IncliudeRightRub(x, y) { 
if (x=='company') { x='companys'; } 
document.write("<b style=\"font-size:11px; color:#3A3A3A\">Категории строительных<br/> материалов и услуг:</b><br/>"); 
document.write("<ul id=\"CatMyUl\">"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=54\""); if (y==54) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Архитектура и дизайн</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=56\""); if (y==56) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Ворота, заборы</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=57\""); if (y==57) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Газоснабжение, котельное оборудование</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=58\""); if (y==58) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Деревянные дома, бани</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=86\""); if (y==86) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Дорожное строительство</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=59\""); if (y==59) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Дренаж, водоотвод</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=60\""); if (y==60) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">ЖБИ, фундаменты</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=61\""); if (y==61) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Инструмент</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=85\""); if (y==85) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Интернет-магазины</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=63\""); if (y==63) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Кирпич, стеновые материалы</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=64\""); if (y==64) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Кондиционирование, вентиляция</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=65\""); if (y==65) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Кровельные материалы</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=66\""); if (y==66) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Лакокрасочные материалы</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=185\""); if (y==185) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Лифты и лифтовое оборудование</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=67\""); if (y==67) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Мебель</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=68\""); if (y==68) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Металлоизделия, металлоконструкции</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=69\""); if (y==69) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Метизы, скобяные изделия</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=70\""); if (y==70) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Мрамор, гранит, камень</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=71\""); if (y==71) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Недвижимость</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=72\""); if (y==72) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Окна, двери, лестницы</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=73\""); if (y==73) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Отделка, ремонт</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=74\""); if (y==74) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Отделочные материалы</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=75\""); if (y==75) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Отопление, водоснабжение, канализация</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=80\""); if (y==80) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Охрана и видеонаблюдение</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=441\""); if (y==441) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Партнерство в строительстве</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=76\""); if (y==76) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Печи, камины</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=77\""); if (y==77) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Пиломатериалы, паркет, ламинат</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=81\""); if (y==81) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Пожарная сигнализация</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=78\""); if (y==78) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Проектирование, геодезия, сметы</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=79\""); if (y==79) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Сантехника, фарфор, фаянс</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=437\""); if (y==437) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Связь, телевидение</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=438\""); if (y==438) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">СРО</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=82\""); if (y==82) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Стекло, зеркала, изделия из стекла</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=186\""); if (y==186) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Строительная спецтехника</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=83\""); if (y==83) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Оборудование и станки</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=84\""); if (y==84) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Строительные информационные порталы</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=87\""); if (y==87) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Строительные материалы</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=88\""); if (y==88) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Строительные работы, строительство зданий</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=89\""); if (y==89) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Тепло-, звуко-, гидроизоляция</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=90\""); if (y==90) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Транспорт, грузоперевозки</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=91\""); if (y==91) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Электроинструменты</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=92\""); if (y==92) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Электромонтажное оборудование</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=184\""); if (y==184) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Электросветотехника, провода, кабели</a></li>"); 
document.write("<li><a href=\"/" + x + "/?ID_SECTION=93\""); if (y==93) { document.write("style=\"text-decoration:none; font-weight:bold;\""); }  document.write(">Другое</a></li>"); 
document.write("</ul>"); 
}


function Incliude_Best() { document.write("<div id=\"result1\"></div>"); sendRequest1('/Incliude_Best.php', 'result1', getRequest1); }


$(document).ready(function(){
        $('#currency a#link1').click(function(){
                $(this).parents('#currency small').find('a').removeClass('selected').end().end();
                $(this).addClass('selected');
                $('table#kursbeznal').fadeOut("fast", function() {
          $('table#kursnal').fadeIn("fast"); });
        });
        $('#currency a#link2').click(function(){
                $(this).parents('#currency small').find('a').removeClass('selected').end().end();
                $(this).addClass('selected');
                $('table#kursnal').fadeOut("fast", function() {
                        $('table#kursbeznal').fadeIn("fast");
                });
        });
        $('#currency a#cbr').click(function(){
                $('div#innerkurs').fadeOut("fast", function() {
                        $('div#cbrkurs').fadeIn("fast");
                });
        });
        $('#currency a#bankurs').click(function(){
                $('div#cbrkurs').fadeOut("fast", function() {
                        $('div#innerkurs').fadeIn("fast");
                });
        });
});




var OBJ;
function myFuncClick(x)
{
var t = document.getElementById (x);
if (OBJ != t)
   {
   if (OBJ) OBJ.style.display = 'none';
   t.style.display = 'block';
   OBJ = t;
   }
//********
else {t.style.display = 'none'; OBJ = null}
//********
} 
