function openW(urlW, nameW, width_w, height_w, scroll_bar) {

	center_x = Math.round((window.screen.availWidth - width_w) / 2);
	center_y = Math.round((window.screen.availHeight - height_w) / 2);

	window.open(urlW, nameW, 'top=' + center_y + ',left=' + center_x + ',width=' + width_w + ',height=' + height_w + ',status=no,titlebar=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,scrollbars=' + scroll_bar);

	return false;

}

function drivenCars(url, name, width_w, height_w, scroll_bar) {

	center_x = Math.round((window.screen.availWidth - width_w) / 2);
	center_y = Math.round((window.screen.availHeight - height_w) / 2);

	window.open(url, name, 'top=' + center_y + ',left=' + center_x + ',width=' + width_w + ',height=' + height_w + ',status=no,titlebar=no,toolbar=no,menubar=no,location=no,resizable=yes,directories=no,scrollbars=' + scroll_bar);

	return false;

}

function closeAutomat(){
	   $('automat').remove();
    }

function getMap() {

    var links = $A($$('.maplink'));
    
    links.each(function(item) {
        Event.observe(item, 'click', function(event) {

            var rows = $A($$('.contactinfo'));
            rows.each(function(row) { 
                row.hide();
            });

            var id = item.href.match(/#(\w.+)/)[1];
            $('dealer_' + id).show();
        });
    });

    if(document.location.href.match(/#(\w.+)/)) {
        var loc = RegExp.$1;    
        $('dealer_' + loc).show();
    }

}
