$(function(){
	$(".alk").each(function(){
		var word = $(this).text();
		var filename = '/adult/'+encodeURIComponent(word)+'/';
		$(this).wrapInner("<a href=\""+filename+"\"></a>");
	});
	$(".als").each(function(){
		var id = $(this).attr("id");
		var tId = id.split("_");
		var tIndex = tId[1];
		
		var filename = $("#alp_"+tIndex).attr("href");
		if( filename != null )
		{
			var target = $("#alp_"+tIndex).attr("target");
			if( target == '' )
			{
				$(this).wrapInner("<a href=\""+filename+"\"></a>");
			}
			else
			{
				$(this).wrapInner("<a href=\""+filename+"\" target='_blank'></a>");
			}
		}
	});
	$(".hlkc").each(function(){
		var id = $(this).attr("id");
		var tId = id.split("_");
		var tIndex = tId[1];
		var link = $("#hlkp_"+tIndex).text();
		$(this).wrap("<a href=\""+link+"\" target=\"_blank\"></a>");
	});
	$(".hlkci").each(function(){
		var id = $(this).attr("id");
		var tId = id.split("_");
		var tIndex = tId[1];
		$(this).wrap("<a href=\"#blog1"+tIndex+"\"></a>");
	});
});


