﻿window.addEvent('domready', function(e) {
    var mapIFrame = $('mapIFrame');
    if ($defined(mapIFrame)) {
        var navigationAnch = $('icoNavigation').getElements('a');
        if ($defined(navigationAnch)) {
            navigationAnch.each(function(anchor, index) {
                anchor.addEvent('click', function(e) {
                    var linkHref = anchor.getProperty('href');
                    mapIFrame.src = linkHref;
                    e.stopPropagation();
                    return false;
                })
            });
        }
    }

//    var gallImgs = $$('.blockPhoto > p > a');

//    if ($defined(gallImgs)) {
//        var scriptMoo = new Element('script', { 'src': "/j/mootools-1.2-more.js", 'type': 'text/javascript' });
//        scriptMoo.inject(window.document.head);
//        var script = new Element('script', { 'src': "/j/milkbox.js", 'type': 'text/javascript' });
//        script.inject(window.document.head);

//        gallImgs.each(function(el, index) {
//            el.addEvent('click', function(e) {
//                var actHref = el.getProperty('href');
//                Milkbox.showThisImage(actHref, el.getProperty('title'));
//                return false;
//            });

//        });
    //    }


});

function changeMapTitle(text) {
    var mapTitle;
    mapTitle = $('mapTitle');
    
    if($defined(mapTitle)) {
        mapTitle.setProperty('text', text);
    }
}
