jQuery.noConflict();
/* 사이드바 롤오버 함수 */
function sidebar_hover(order, path_name){		
	var obj = jQuery("#sidebar .menu ul li:nth-child(" + order + ") a");		
	var obj_img = jQuery("#sidebar .menu ul li:nth-child(" + order + ") a img");
	var tmpstr = "/images/" + path_name + "/sidebar_0" + order;		
	var obj_selected = jQuery("#sidebar .menu ul li:nth-child(" + order + ") a.selected");

	jQuery(obj).hover(
		function() {
			jQuery(obj_img).attr("src", tmpstr + "_on.gif");			
		},
		function() {
			if ( obj_selected.length > 0 )
			{
				return false;
			} else {
				jQuery(obj_img).attr("src", tmpstr + "_off.gif");
			}
		}
	);						
}	

jQuery(document).ready(function() {		
	
	/* 이미지 등록 	
	var count = 0;
	jQuery("#add_File_A").click(function() {		
		if ( count < 4 )
		{
			jQuery(".added").clone(true).removeClass("added").insertBefore("#add_File");			
			jQuery(this).parent().prev().find("span").removeClass("hidden");			
			count++;
			return false;			
		} else { 
			jQuery(".warning").text("* 파일은 최대 5개까지 업로드 가능합니다.");
			return false;
		}
	});	

	/* 이미지 파일 인풋박스 삭제 
	jQuery(".delete").click(function() {		
		jQuery(this).parent().parent("div").remove();		
		jQuery(".warning").text(" ");
		count -= 1;
		return false;
	});	
	*/

	jQuerythumbnail = jQuery(".photo_Gallery .thumbnail");
	jQuerypreview = jQuery(".photo_Gallery .preview img");
	jQuerythumbnail.find("a").click(function() {
		var IMAGE_PATH = jQuery(this).attr("href");
		jQuerypreview.attr("src", IMAGE_PATH);
		return false;
	});		

	/* 팝업 띄우기(사이드바 배너) */	
	function sidebar_POPUP( popup_HREF, WINDOW_NAME, window_WIDTH, window_HEIGHT, SCROLLBAR) {		
		var browser_Width = parseInt(screen.width, 10);
		var browser_Height = parseInt(screen.height, 10);
		var obj_OFFSET_X = ( browser_Width / 2 ) - (window_WIDTH / 2);
		var obj_OFFSET_Y = ( browser_Height / 2 ) - (window_HEIGHT / 2) - 80;		
		window.open(popup_HREF, WINDOW_NAME, "width=" + window_WIDTH +",height=" + window_HEIGHT + ",left=" + obj_OFFSET_X + ", top=" + obj_OFFSET_Y + ",history=no,resizable=no,status=no,scrollbars=" + SCROLLBAR + ",menubar=no");
		return false;
	}		
	
	jQuery(".go").children("a").click(function() {		
		var root = jQuery(this).parent().parent().attr("class");		
		var w_WIDTH;
		var w_HEIGHT;		
		switch ( root )
		{
			case "link_01": 				
				var w_WIDTH = 705;
				var w_HEIGHT = 800;		
				var scroll_CHECK = "yes";
				var W_NAME = "pop15";
				break;
			case "link_02":
				var w_WIDTH = 690;
				var w_HEIGHT = 388;		
				var scroll_CHECK = "no";
				var W_NAME = "pop03";				
				break;
		}		
		var popup_LOCATION = jQuery(this).attr("href");
		sidebar_POPUP( popup_LOCATION, W_NAME, w_WIDTH, w_HEIGHT, scroll_CHECK);				
		return false;
	});

	/* 팝업01 */
	jQuery(".popup_01").click(function() {
		var b_Width = (parseInt(screen.width, 10) / 2) - 155;
		var b_Height = (parseInt(screen.height, 10) / 2) - 125;
		window.open("/pages/popup/popup_01.php", "pop01", "width=310,height=125, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,scrollbars=no,menubar=no");
		return false;
	});	

	/* 우편번호 */
	jQuery(".popup_Zipcode").click(function() {
		var b_Width = (parseInt(screen.width, 10) / 2) - 155;
		var b_Height = (parseInt(screen.height, 10) / 2) - 250;
		window.open("/pages/popup/popup_zipcode.php", "zipcode", "width=310,height=350, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,scrollbars=no,menubar=no");
		return false;
	});	

	/* 팝업05 */
	jQuery(".popup_05").click(function() {
		var b_Width = (parseInt(screen.width, 10) / 2) - 255;		
		window.open("/pages/popup/popup_05.php", "pop05", "width=600,height=800, left=" + b_Width + ",top =90,history=no,resizable=no, status=no,menubar=no");
		return false;
	});	

	/* 팝업06 */
	jQuery(".popup_06").click(function() {
		var b_Width = (parseInt(screen.width, 10) / 2) - 200;
		var b_Height = (parseInt(screen.height, 10) / 2) - 175;
		window.open("/pages/popup/popup_06.php", "pop06", "width=400,height=225, left=" + b_Width + ",top =" + b_Height +",history=no,resizable=no,status=no,scrollbars=no,menubar=no");
		return false;
	});	
});

