/**
 * Copyright 2008 SK Communications. All rights reserved.
 * @author umkki
 * @since 2008.02.27
 * @desc 뜨거운 감자 페이지 팝업
 */

if(typeof(Page) == "undefined") {
	Page = {};
}

Event.observe(window, 'load', function() {
	var hotPotatoRecommendDialog = new Modal.HotPotatoRecommendDlg('hot_potato_recommend', {
		'zIndex':9901, 
		'top':'225px', 
		'left':'105px'
	});

});
	
Page.HotPotato = Class.create();
Object.extend(Page.HotPotato, {
	current: null,
	showMessage: function(event) {
		if (Page.HotPotato.current && Page.HotPotato.current.showMessage) {
			Page.HotPotato.current.showMessage(event);
		}
	}
});
Object.extend(Page.HotPotato.prototype, {
	DESC_BOX_CLASS: 'hot_tag_desc',
	initialize: function(options) {
		this.tagLength = options.tagLength;
		this.descBox = Array();
		for (var i=1; i<this.tagLength+1; i++) {
			this.descBox.push(document.getElementsByClassName(this.DESC_BOX_CLASS+i)[0]);
		}
		
		Page.HotPotato.current = this;
	},
	
	showMessage: function(event) {
		var element = Event.element(event);
		var id = element.id;
		Event.stop(event);
	    	
		for (var i=0; i<this.descBox.length; i++) {
			if (this.descBox[i].className.indexOf(id) != -1) {
				this.descBox[i].show();
			}
			else {
				this.descBox[i].hide();
			}
		}
	}
});
