$().ready(function () {
	//	$("#sub_menu_wrap ul li a").each(function (i, el) {
	//		var s = $(el).html();
	//		$(el).html("<span>" + s + "</span>");
	//	}); 

//	$("ul.dropdown > li > a").each(function (i, el) {
//		var s = $(el).html();
//		$(el).html("<i><b>" + s + "</b></i>");
//	});

	$("._sidebarMenu .level1").columnize({
		columns: 3,
		width: 573,
		buildOnce: false,
		overflow: {
			id: ".thin",
			//height: 336,
			height: 530,
			doneFunc: function () {
				$('.column').width('160px');
				$(".column:empty").css("display", "none");
			}
		}
	});

	$('.reply_hide .reply').click(function () {
		$(this).parent().after($('.comment_block_in'));
		$('#rplid').val($(this).attr('rplid'));
	});
	$('.reply_hide .new_comment').click(function () {
		$(this).parent().after($('.comment_block_in'));
		//$('.comment_block').prepend($('.comment_block_in'));
		$('#rplid').val('0');
	});

	//setTimeout('dplctbnr();', 500)

	//comment_block

	/*
	$('.thumb li').hover(
	function () {
	$('.viewer #li' + lastHpLi).removeClass('active');
	//$('.thumb #li' + lastHpLi).removeClass('active');

	$('.thumb li').removeClass('active');
	$(this).addClass('active');
	lastHpLi = $(this).attr('vvid');
	$('.viewer #li' + lastHpLi).addClass('active');
	},
	function () {
	//$(this).removeClass('active');
	}
	);
	*/
});
//var lastHpLi = 1;

/*
<iframe allowtransparency="true" frameborder="0" height="60" hspace="0" marginwidth="0" marginheight="0" 
	onload="var i=this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;
	try{d=w.document}catch(e){}
	if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){
		if(h.call){i+='.call';setTimeout(h,0)}else if(h.match){i+='.nav';w.location.replace(h)}s.log&amp;&amp;s.log.push(i)}" 
	scrolling="no" vspace="0" width="468" id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;"></iframe>

*/

function dplctbnr() {
	if ($$('banner_adsense')) {
		var banner = $('#banner_adsense').clone().html();
		var iframe_html = $('#banner_adsense iframe').contents().find('html').html();
		var c = 0;
		if (banner.length > 0) {
			$('.articles div ul li:nth-child(3n), .results-search-list div ul li:nth-child(3n)').each(function (index) {
				//alert(index + ': ' + $(this).text());

				//var $div = $('<div></div>').hide().after($(this)).html(banner); //.remove();				
				//var $div = $(this).after($('<li></li>').append($('#banner_adsense').clone()));
				//$(this).after($('<li></li>').append($('#banner_adsense').html()));
				//$('<li></li>').append($('#banner_adsense').html()).after($(this));



				$(this).after($('<li></li>').append($('#banner_adsense').html()));
				//$(this).after($('<li></li>').append($('#banner_adsense iframe').contents().find('html').html()));
				//$(this).after($('<li></li>').append(.html()));
				//$('#banner_adsense').appendTo($(this));


				/*c++;
				var ins1 = $(this).next('li').find('div').find('ins');
				var ins2 = ins1.find('ins');
				var ifrm = ins2.find('iframe');
				//alert(ifrm.contents().find('html').html())
				try{
				ifrm.contents().find('html').html(iframe_html);
				}catch(e){}
				ins2.attr('id', 'aswift_' + c + '_anchor');
				ifrm.attr('id', ifrm.attr('id').substr(0, ifrm.attr('id').length - 1) + c);
				ifrm.attr('name', ifrm.attr('name').substr(0, ifrm.attr('name').length - 1) + c);
				*/

				//$(this).after($('<li></li>').append($('#banner_adsense').html()));
				//$('#slot' + userContext).find('.adsense_slot').html($('<div class="dvadsense clearfix"></div>').append($('#dvadsense iframe').clone()));

				//$('.articles div ul li:nth-child(3n)').after("<li>" + banner + "</li>");
				//$(this).after("<li>" + banner + "</li>");
			});

			//$('.articles div ul li:nth-child(3n)').load("<li>" + banner + "</li>");
			//$('.results-search-list div ul li:nth-child(3n)').after("<li>" + banner + "</li>");
			//$('#banner_adsense').css('display', 'none');
		}
	}
}

function tglrply(obj) {
	if (!obj.hasClass("cmntopen")) {
		//obj.parent().next('.comment_in').animate({ 'height': "auto" }, 'fast');
		obj.parent().next('.comment_in').css({ height: "auto" });
		obj.addClass("cmntopen");
		//obj.parent().next('.comment_in').show('fast');
	} else {
		//obj.parent().next('.comment_in').animate({ height: "0" }, 'fast');
		obj.parent().next('.comment_in').css({ height: "0" });
		//obj.parent().next('.comment_in').hide('fast');
		obj.removeClass("cmntopen");
	}
}

