
var $j = jQuery.noConflict();

$j(function(){

$j("#navigation li a").bind("focus mouseover", function(){
onimg($j(this));
$j(this).parent().siblings().children("ul").hide();
$j(this).parent().children("ul").show();
});
$j("#navigation").mouseleave(function(){
$j(this).children("li").children("ul").hide();
});
$j("#navigation li a").bind("blur mouseout", function(){
offimg($j(this));
});

$j("#navigation li ul li a").bind("keyup mouseover",function(){
onimg($j(this).parent().parent().parent().children("a"));
});

$j("#navigation li ul").mouseleave(function(){
offimg($j(this).parent().children("a"));
$j(this).hide();
});

$j("#navigation li ul .sublast a").blur(function(){
$j(this).parent("li").parent("ul").hide();
offimg($j(this).parent().parent().parent().children("a"));
});

$j("#tabboard li a").bind("focus mouseover", function(){
onimg($j(this));
});

$j("#tabboard li a").bind("blur mouseout", function(){
offimg($j(this));
});

function onimg(imgtarget) {
var onsrc = imgtarget.children("img").attr("src");
var chkon = onsrc.slice(-6, -4);
var typeis = onsrc.slice(-4);
if (chkon == "on") {
} else {
if(typeis == ".gif") {
onsrc = onsrc.replace(/.gif/, "on.gif");
} else if(typeis == ".jpg") {
onsrc = onsrc.replace(/.jpg/, "on.jpg");
} else if(typeis == ".png") {
onsrc = onsrc.replace(/.png/, "on.png");
} else {
}
imgtarget.children("img").attr("src", onsrc);
}
}

function offimg(imgtarget) {
var offsrc = imgtarget.children("img").attr("src");
var chkoff = offsrc.slice(-6, -4);
var typeis = offsrc.slice(-4);
if (chkoff == "on") {
if(typeis == ".gif") {
offsrc = offsrc.replace(/on.gif/, ".gif");
} else if(typeis == ".jpg") {
offsrc = offsrc.replace(/on.jpg/, ".jpg");
} else if(typeis == ".png") {
offsrc = offsrc.replace(/on.png/, ".png");
} else {
}
} else {
}
imgtarget.children("img").attr("src", offsrc);
}

var nowis=1;
showboard(nowis);

$j("#tabboard li a").bind("keyup mouseover", function(){
nowis = $j(this).parent().attr("id").slice(-1);
showboard(nowis);
});

function showboard(now) {
$j("#tab1, #tab2").each(function(){
var num = $j(this).attr("id").slice(-1);
if (now == num) {
$j(this).show();
} else {
$j(this).hide();
}
});
}

// ***** 메인메뉴 게시물추출 탭보드 , 포토보드 롤오버 및 HIDDEN, VISIBLE EVENT ******

function tabboard_change(tab_target){

	if($j(tab_target).children("img").attr("id") == "tabboard_bt1") {
		$j("#tabboard1").show();
		$j("#tabboard2").hide();
	}
	else{
		$j("#tabboard2").show();
		$j("#tabboard1").hide();
	}
}

$j("#tabboard_bt > a:nth-child(n)").bind("mouseover focus", function(){
tabboard_change($j(this));
});

});

