jQuery.noConflict();
var jq$ = jQuery;
var key = jq$("meta[name=Keywords]").attr("content");
var self = encodeURI(decodeURI(location.href));

jq$(function()
{
	if( key )
	{
		jQuery.ajax(
		{
			url : "/common/akgrid.shtml?keyword="+encodeURIComponent(key)+"&url="+self,
			type : "post",
			success: function(httpObj)
			{
				var rslt = eval(httpObj);
				if( rslt )
				{
					var text1 = '';
					var text2 = '';

					for(i = 0; i < rslt.length; i++)
					{
						text2 += '<div class="item item_hover">\n';
						text2 += '<div class="item_body">\n';
						if(rslt[i].url) text2 += '<a href="' + rslt[i].url + '" rel="bookmark">';
						if(rslt[i].image) text2 += '<img src="' + rslt[i].image + '" width="174" height="116" />';
						if(rslt[i].url) text2 += '</a>\n';
						text2 += '<div class="title"><a href="' + rslt[i].url + '" rel="bookmark">' + rslt[i].title + '</a></div>\n';
						if( rslt[i].text )
						{
							text2 += '<div class="description">';
							if(rslt[i].icon_url) text2 += '<a href="' + rslt[i].icon_url+ '"  rel="bookmark">';
							if(rslt[i].icon) text2 += '<img src="' + rslt[i].icon + '" alt="' + rslt[i].icon_text + '" style="float:right;margin:0 0 6px 6px;" />';
							if(rslt[i].icon_url) text2 += '</a>';
							if(rslt[i].icon2) text2 += '<img src="' + rslt[i].icon2 + '" alt="' + rslt[i].icon_text2 + '" style="float:right;margin:0 0 6px 6px;" />';
							text2 += rslt[i].text;
							text2 += '</div>\n';
						}
						text2 += '</div>\n';
						if( rslt[i].footer )
						{
							text2 += '<div class="item_footer">\n';
							text2 += '<small><span style="font-weight:bold">' + rslt[i].footer + '</span></small>\n';
							text2 += '</div>\n';
						}
						text2 += '</div>\n\n\n';
					}

					if( jq$('#shopItem') ){
						jq$('#shopItem').replaceWith(text2);
						jq$.auto.init();
						jq$.gif_animation.init();
						jq$.grid.window.preload();
					}
				}
			}
		});
	}

	if( self.match(/jp\/(index.html)?$/) )
	{
		jQuery.ajax(
		{
			url : "/common/aktopics.shtml?url="+self,
			type : "post",
			success: function(httpObj)
			{
				var rslt = eval(httpObj);
				if( rslt )
				{
					var text1 = '';
					var text2 = '';

					for(i = 0; i < rslt.length; i++)
					{
						text1 += '<li>\n';
						if(rslt[i].url) text1 += '<a href="' + rslt[i].url + '" title="' + rslt[i].title + '">';
						text1 += '<b>' + rslt[i].title + '</b>';
						if(rslt[i].url) text1 += '</a>\n';
						if(rslt[i].text)
						{
						text1 += '<span style="margin-left:8px">' + rslt[i].text + '</span>\n';
						}
						text1 += '</li>\n';
					}

					var text2 = jq$('#evlist').html();
					text1 += text2;
					jq$("#evlist").html(text1);
				}
			}
		});
	}


	jq$.auto.init();
	jq$.popup.init();
	jq$.gif_animation.init();
	jq$.gif_rotation.init();
	jq$.grid.window.preload();

});