
function enableImageClick () {
    $$('a').each(function(el) {

        if (!el.get('rel')) return;

        if(el.get('rel').substr(0,9) == 'dms_image') {
            var src   = el.get('href');
            var image = el.getFirst();
            image.addEvent('mouseover', function() {
                $('tpl_photo').firstChild.setAttribute("src", src);
            });
            image.addEvent('click', function() {
                return false;
            });
        }
    });
}

window.addEvent('domready', function() {
    enableImageClick();
    showMoreLink();
});

function showImage(image) 
{
 //   $('tpl_photo').style.backgroundImage = "url("+image+")";

    $('tpl_photo').firstChild.setAttribute("src", image);
}

function showMoreLink()
{
    elem = $('tpl_content');
    if(elem.clientHeight < elem.scrollHeight) {
        // Show link
        $('tpl_more_link').style.display="block";
    }
}


function scroll() {
    var myFx = new Fx.Scroll('tpl_content', {
    offset: {
        'x': 0,
        'y': 400
    }
}).toTop();
myFx.set(0, 450);
$('tpl_more_link').style.display="none";
}
