function openWindow(filename, w, h, winname)
{

    var nWidth;
    var nHeigth;
    if (h) nHeigth = h; else nHeigth = 520;
    if (w) nWidth = w; else nWidth = 700;
    if (!winname) winname = "_blank";
    var desktop = window.open(filename, winname,"width="+nWidth+",height="+nHeigth+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");

};

function loadDoc(link, id) {
var req;

if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {

req = new ActiveXObject("Microsoft.XMLHTTP");
}
if (req) {
req.onreadystatechange = function () {

if (req.readyState == 4) {

if (req.status == 200) {


var response = req.responseText;

//alert(id+' ; '+document.getElementById(id));
//alert(response);
document.getElementById(id).innerHTML = response;
//alert(1);
} else {
  alert('Невозможно загрузить: ' + req.statusText);
}
}
}
  link = link + '&random=' + Math.random();
  req.open("GET", link, true);
  req.send(null);
}
}

function start_search()
{
    var val = document.getElementById('search_string').value;
    if ( val != '' ) { loadDoc("/search/?search="+val+"&test=рус", "vaclist"); }
    
}





window.addEvent('domready', function() {
	
	//create our Accordion instance
	var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.element', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#ce0b1b');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#555');
		}
	});


});

        function imgChange1( img ) { document.getElementById('btmain').src = img; }
        function imgChange2( img ) { document.getElementById('btabout').src = img; }
        function imgChange3( img ) { document.getElementById('btskm').src = img; }
        function imgChange4( img ) { document.getElementById('btcontacts').src = img; }
	function imgChange5( img ) { document.getElementById('btforum').src = img; }


function comments_trigger() {
                            
  var id = 'comments_holder';
                            
    if (document.getElementById(id).style.display == 'block' ) {
    document.getElementById(id).style.display = 'none'; }
    else
    { document.getElementById(id).style.display = 'block'; }
}