jQuery.noConflict();
var jq$ = jQuery;
var key = jq$("meta[name=Keywords]").attr("content");
var self = encodeURI(decodeURI(location.href));

jq$(function()
{
	if( key )
	{
		if( self.match(/shop\/contents\//) )
		{
			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$('#grid').html() )
						{
							var text1 = jq$('#grid').html();
							text1 = text1.replace(/<!--{ITEM}-->/gi, text2);
							jq$("#grid").html(text1);

							jq$.auto.init();
//							jq$.popup.init();
//							jq$.gif_animation.init();
//							jq$.gif_rotation.init();
							jq$.grid.window.preload();
						}
					}
				}
			});
		}
	}

});