﻿var Press = new Class({
    initialize: function(options){
	    this.options = Object.extend({

	    }, options || {});

	    $$('div#mainArea div.top  a').each(this.initReadMore);
	    
	    var idx = window.location.toString().indexOf("#");
	    if(idx > 0) {
	        var hash = window.location.hash.substring(1);
	        var idx = hash.substring(2);
	        
	        var btm = $("btm"+idx);
	        btm.setStyle("display", "inline");
	        
	        new Fx.Scroll(window, {
                wait: false,
                duration: 1000,
                offset: {'x': 0, 'y': 0} }).toElement("btm"+idx);
	            }
    },
    
    initReadMore: function(item) {
        item.addEvent('click', function(e) {
            item.blur();          
            var prnt = item.getParent().getParent().id;
            var btm = $("btm"+prnt.substring(3));
            if(btm.getStyle("display")=="none")
                btm.setStyle("display", "inline");
            else
                btm.setStyle("display", "none");
        });
    }
});