// border for block (main page)
(function($) {
	$.fn.blact=function(options) {
		var set=$.extend({nClass:"on"},options);
		return this.each(function() {
			$(this).hover(function() { $(this).addClass(set.nClass); },function() { $(this).removeClass(set.nClass); })
		});
	};
})(jQuery);

// ver. menu
(function($) {
	$.fn.vm=function(options) {
		options=jQuery.extend({speedIn:500,speedOut:200},options);
		var $obj=$(this).find("ul"); var flag="none";
		return this.each(function() {
			var x=0;
			$obj.each(function() {
				if ($(this).attr("class")) {
					n=$(this).attr("class");
					$(this).after('<img src="i/vmenu/'+n+'.png" width="290" height="8" class="bl">');
					$(this).find("> li > a").bind("click",function() {
						if ($(this).next().is("ul")) {
							if ($(this).next()!=flag&&flag!="none") {
								$(flag).slideUp(options.speedIn); $(this).next().slideDown(options.speedIn);
								flag=$(this).next();
							} else if ($(this).next()==flag&&flag!="none"&&!$(this).attr("status")) {
								$(flag).slideUp(options.speedOut); flag="none";
							} else if (flag=="none") {
								$(this).next().slideDown(options.speedIn); flag=$(this).next();
							}
						}
					});
					if ($(this).attr("status")) { $(this).find("> li > ul").show(); flag=$(this).find("> li > ul"); }
				}
			});
		});
	};
})(jQuery);

$j(function($) {
	Cufon.replace(".title");
	$(".left-block").blact({nClass:"l-on"});
	$(".center-block").blact({nClass:"c-on"});
	$(".right-block").blact({nClass:"r-on"});
	$(".scroll").is("div")?$(".scroll").jScrollPane({showArrows:true,scrollbarWidth:15}):null;
	$("#vmenu").vm();
	Cufon.replace("h1,h2,h3,h4");
});