jQuery(document).ready(function(){
	jQuery('a.popup').click(function () {

		var popupdetail= jQuery(this).siblings('.popup_detail');
		var popupbox = jQuery('#popupbox');

		var win_w = jQuery(window).width();
		var win_h = jQuery(window).height();
		var win_l = jQuery(window).scrollLeft();
		var win_t = jQuery(window).scrollTop();
		jQuery('#popupbox')
			.css('left', win_w/2-jQuery(popupbox).width()/2+win_l)
			.css('top', win_h/2-jQuery(popupbox).height()/2+win_t);

		jQuery(popupbox).html(jQuery(popupdetail).html()); 
		jQuery(popupbox).fadeIn("fast");
		return false;
	});
	jQuery('#popupbox').click(function(){
		jQuery(this).fadeOut("fast");
		return false;
	});
});

jQuery(document).ready(function(){
	jQuery('#weather_submenubtn').click(function () {
		if(jQuery('#top_weather_arealist').css('display') != 'block'){
			jQuery('#top_weather_arealist').fadeIn("fast").fadeTo("fast", 0.9);
		}else{
			jQuery('#top_weather_arealist').fadeOut("fast");
		}
		return false;
	});
	jQuery('#top_weather_arealistclosebtn a').click(function () {
		jQuery('#top_weather_arealist').fadeOut("fast");
		return false;
	});

	jQuery('#horoscope_submenubtn').click(function () {
		if(jQuery('#top_horoscope_list').css('display') != 'block'){
			jQuery('#top_horoscope_list').fadeIn("fast").fadeTo("fast", 0.9);
		}else{
			jQuery('#top_horoscope_list').fadeOut("fast");
		}
		return false;
	});
	jQuery('#top_horoscope_listclosebtn a').click(function () {
		jQuery('#top_horoscope_list').fadeOut("fast");
		return false;
	});
});

