/* 아이디 중복확인 */
function ID_CHECK() {
	$(".popup_id_check").click(function() {
		var THIS_HREF = $(this).attr("href");
		var b_Width = (parseInt(screen.width, 10) / 2) - 165;
		var b_Height = (parseInt(screen.height, 10) / 2) - 250;
		window.open( THIS_HREF , "id_check", "width=330,height=200, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,scrollbars=no,menubar=no");
		return false;
	});
}


/* FTP 아이디 중복확인 */
function FTPID_CHECK() {
	$(".popup_id_check").click(function() {
		var THIS_HREF = $(this).attr("href");
		var b_Width = (parseInt(screen.width, 10) / 2) - 165;
		var b_Height = (parseInt(screen.height, 10) / 2) - 250;
		window.open( THIS_HREF , "ftpid_check", "width=330,height=200, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,scrollbars=no,menubar=no");
		return false;
	});
}

/* 마이서비스 : 내홈페이지 도메인 적용하기 팝업 */
function ADAPT_HOMEPAGE() {
	$(".popup_adapt_homepage a").click(function() {
		var THIS_HREF = $(this).attr("href");
		var b_Width = (parseInt(screen.width, 10) / 2) - 237;
		var b_Height = (parseInt(screen.height, 10) / 2) - 200;
		window.open( THIS_HREF , "adapt_homepage", "width=474,height=331, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,scrollbars=no,menubar=no");
		return false;
	});	
}

/* 마이서비스 : 내 호스팅 도메인 적용하기 팝업 */
function ADAPT_HOSTING() {
	$(".popup_adapt_hosting a").click(function() {
		var THIS_HREF = $(this).attr("href");
		var b_Width = (parseInt(screen.width, 10) / 2) - 237;
		var b_Height = (parseInt(screen.height, 10) / 2) - 200;
		window.open( THIS_HREF , "adapt_hosting", "width=474,height=331, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,scrollbars=no,menubar=no");
		return false;
	});	
}

/* 우편번호 찾기 팝업 */
function FIND_ZIPCODE() {
	$(".popup_find_zipcode").click(function() {
		var THIS_HREF = $(this).attr("href");
		var b_Width = (parseInt(screen.width, 10) / 2) - 165;
		var b_Height = (parseInt(screen.height, 10) / 2) - 420;
		window.open( THIS_HREF , "find_zipcode", "width=330,height=360, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,scrollbars=no,menubar=no");
		return false;
	});	
}

/* 도메인 정보 보기 */
function DOMAIN_INFO() {
	$(".popup_domain_info").click(function() {
		var THIS_HREF = $(this).attr("href");
		var b_Width = (parseInt(screen.width, 10) / 2) - 352;
		var b_Height = (parseInt(screen.height, 10) / 2) - 300;
		window.open( THIS_HREF , "whois_domain", "width=733,height=500, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,menubar=no,scrollbars=yes");
		return false;
	});	
};

/* 하단 결제방법선택 */
function BOTTOM_PAY_SELECTION() {
	$(".homepage .line03 .order01 .right_btn input:radio").click(function() {		
		$(".homepage .line03").removeClass("selected");
		$(this).parent().parent().parent().addClass("selected");
	});
}

/* 파일 업로드 배경그리기 */
function FILE_UPLOAD_BG() {
	$(".upload_files li:odd").css("background-color","#f8f8f8");
	$(".upload_files li span.title").hover(
		function() {
			$(this).css({
				"text-decoration":"underline"				
			});
		},
		function() {
			$(this).css("text-decoration","none");
		}
	);
}

/* 마이서비스 : 유지보수 작업 요청하기 팝업 */
function REQUEST_MAINTENANCE() {
	$("#popup_request_maintenance").click(function() {
		var THIS_HREF = $(this).attr("href");
		var b_Width = (parseInt(screen.width, 10) / 2) - 360;
		var b_Height = (parseInt(screen.height, 10) / 2) - 420;
		window.open( THIS_HREF , "request_maintenance", "width=717,height=760, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,scrollbars=no,menubar=no");
		return false;
	});
}

/* 로그인폼에서 포커스되었을 때 배경 토글 */
function REMOVE_BG( obj_class, obj_id ) {
	$(obj_id).bind("focus",function(){
			$(this).removeClass(obj_class);
	});

	$(obj_id).bind("blur", function(){
	var THIS_VAL = $.trim($(this).val());
	if ( THIS_VAL == "" ) {
		$(this).addClass(obj_class);
		$(this).val("");
	} 
});
/*
	$(obj_id).bind({
		focus: function() {			
			$(this).removeClass(obj_class);
		},
		blur: function() {
			var THIS_VAL = $.trim($(this).val());
			if ( THIS_VAL == "" ) {
				$(this).addClass(obj_class);
				$(this).val("");
			} 
		}
	});
*/
}

/* 마우스 오버시 이미지 온오프 시키기 */
function TOGGLE_ON_OFF(obj, str_length) {
	$(obj).hover(
		function() {
			var STR = $(this).find("img:first").attr("src").substr(0, str_length);			
			$(this).find("img:first").attr("src", STR + "on.gif");	
		},
		function() {
			var STR = $(this).find("img:first").attr("src").substr(0, str_length);
			$(this).find("img:first").attr("src", STR + "off.gif");	
		}		
	);
}

/* 도메인에서 물음표 이미지에 툴팁 띄움 */
function TOOLTIP_DOMAIN(TITLE, DESCRIPTION, WIDTH) {
	$("img.tooltip_question").hover(
		function() {							
			$(".tooltip_content p.title").text(TITLE);
			$(".tooltip_content p.description").text(DESCRIPTION);		
			var LEFT = $(this).offset().left - 10;
			var TOP = $(this).offset().top + 23;
			
			$(".tooltip_content")
				.css({
					"left" : LEFT,
					"top" : TOP,
					"width" : WIDTH + "px"
				})
				.show();		
		},
		function() {
			$(".tooltip_content").hide();
		}
	);
}
