﻿var openmain = null, submenu = null;
$(document).ready(function(){	
	//$(document).find("title").text("isobar Korea");
	if (openmain != null){
		$(".unb li").eq(openmain).find("img").attr("src", $(".unb li").eq(openmain).find("img").attr("src").replace("_off","_on") );
	}

	$(".btm_section section:first-child").css({
		marginLeft : "18px"
	});
	$(".btm_section section").eq(2).css({
		borderRight : "none"
	});
	$(".f_mnu li:first-child").css("backgroundImage","none");
	
	$(".comment_list > ul > li:first-child").css("borderTop","none");

	$(".list_type2 li:last-child").css("backgroundImage","none");


	if ($(".comment_input input").eq(0).val()=="") {
		$(".comment_input input").eq(0).css("backgroundImage","url('../images/common/board/txtbg_name.gif')").end()
		.eq(0).bind("focus",function(){
			if ($(this).val() == ""){				
				$(this).css("backgroundImage","none");
			}
		}).end()
		.eq(0).bind("blur",function(){
			if ($(this).val() == ""){				
				$(this).css("backgroundImage","url('../images/common/board/txtbg_name.gif')");
			}
		});
	}
	if ($(".comment_input input").eq(1).val()=="") {
		$(".comment_input input").eq(1).css("backgroundImage","url('../images/common/board/txtbg_email.gif')").end()
		.eq(1).bind("focus",function(){
			if ($(this).val() == ""){				
				$(this).css("backgroundImage","none");
			}
		}).end()
		.eq(1).bind("blur",function(){
			if ($(this).val() == ""){				
				$(this).css("backgroundImage","url('../images/common/board/txtbg_email.gif')");
			}
		});
	}

	if ($(".comment_input input").eq(2).val()=="") {
		$(".comment_input input").eq(2).css("backgroundImage","url('../images/common/board/txtbg_website.gif')").end()
		.eq(2).bind("focus",function(){
			if ($(this).val() == ""){				
				$(this).css("backgroundImage","none");
			}
		}).end()
		.eq(2).bind("blur",function(){
			if ($(this).val() == ""){				
				$(this).css("backgroundImage","url('../images/common/board/txtbg_website.gif')");
			}
		});
	}

	if ($(".comment_input textarea").val()=="") {
		$(".comment_input textarea").css("backgroundImage","url('../images/common/board/txtbg_comment.gif')")
		.bind("focus",function(){			
			if ($(this).val() == ""){				
				$(this).css("backgroundImage","none");
			}
		})
		.bind("blur",function(){
			if ($(this).val() == ""){				
				$(this).css("backgroundImage","url('../images/common/board/txtbg_comment.gif')");
			}
		});
	}


});

function varwidth(imgobj,w){
	var maxwidth = w;
	if(imgobj.width > maxwidth){
		imgobj.height = imgobj.height / (imgobj.width / maxwidth);
		imgobj.width = maxwidth;
	}
}

function set_size(){	
	var doc_H = $(document).height();				
	var doc_W = $(window).width();	
	doc_W = (parseInt(doc_W) > 990) ? doc_W : 990;
	
	$("#black_bg").css({
		width : doc_W + "px",
		height: doc_H + "px"				
	});		
}
$(window).bind("resize",set_size);

