 
//@desc	: Gi_info_Read.asp, Booth_Gi_info_Read.asp ¿¡¼­ »ç¿ë

	(function($){
		 $("document").ready(function() {		
			
			
			// ±â¾÷ »çÁø Á¤º¸
			$(".devImgPhoto1").mouseover(function() {					
				var imgSrc = $(this).attr("src");
				//imgSrc = imgSrc.substr(imgSrc.lastIndexOf("="));
				imgSrc = imgSrc.replace("http://coimg.jobkorea.co.kr/Company/Visual_Co/ThumbNail/","");
				imgSrc = "<img src='http://file2.jobkorea.co.kr/Company/Visual_Co/Image_View_Original.asp?FN="+imgSrc+"' width='288' height='217'>";
				$("#devCoBigImg").html(imgSrc);	
				var imgTitle = $(this).attr("alt");
				$("#devCoBigTitle").html(imgTitle);						
			});

			$(".devImgPhoto2").mouseover(function() {					
				var imgSrc = $(this).attr("src");				
				imgSrc = "<img src='"+imgSrc+"' width='288' height='217'>";
				$("#devCoBigImg").html(imgSrc);	
				var imgTitle = $(this).attr("alt");
				$("#devCoBigTitle").html(imgTitle);	
			});



			// ±â¾÷ »çÁø Á¤º¸_New
			$(".devPhotoCo").mouseover(function() {					
				var imgSrc='';
				$(".devPhotoCo").removeClass("selected");
				$(this).addClass("selected");

				$(".devPhotoCo.selected img").each(function(i) {        
						var imgSrc = $(this).attr("src");

						if (imgSrc.toLowerCase().indexOf("coimg.jobkorea.co.kr") > 0 ){
							//imgSrc = imgSrc.substr(imgSrc.lastIndexOf("="));
							imgSrc = imgSrc.replace("http://coimg.jobkorea.co.kr/Company/Visual_Co/ThumbNail/","");
							imgSrc = 'http://file2.jobkorea.co.kr/Company/Visual_Co/Image_View_Original.asp?FN=' + imgSrc;
						} else {
							imgSrc = imgSrc.replace("img_sample_no.jpg","img_sample_noimg_big_1.gif");
						}

						imgSrc = "<img src='"+imgSrc+"' width='288' height='217'>";
        
						$("#devCoBigImg" + i).html(imgSrc);	
						$("#devCoBigTitle" + i).html( $(this).attr("alt") );				
				 })

				$("#devCoBigImg").html(imgSrc);	
				var imgTitle = $(this).attr("alt");
				$("#devCoBigTitle").html(imgTitle);						
			});

			// ±Ù¹«ºôµù »çÁø Á¤º¸_New
			$(".devPhotoBd").mouseover(function() {					
				var imgSrc='';
				$(".devPhotoBd").removeClass("selected");
				$(this).addClass("selected");

				$(".devPhotoBd.selected img").each(function(i) {        
					var imgSrc = $(this).attr("src");
					
					if (imgSrc.toLowerCase().indexOf("file2.jobkorea.co.kr") > 0 ){
						imgSrc = imgSrc.substr(imgSrc.lastIndexOf("=")+1);
						imgSrc = imgSrc.replace("http://coimg.jobkorea.co.kr/Company/Visual_Co/ThumbNail/","");
						imgSrc = "<img src='http://file2.jobkorea.co.kr/Company/Guin_BD/Image_View.asp?FN="+imgSrc+"' width='288' height='217'>";
					} else {
						imgSrc = imgSrc.replace("img_sample_no.jpg","img_sample_noimg_big_1.gif");
						imgSrc = "<img src='"+imgSrc+"' width='288' height='217'>";				
					}

					$("#devBdBigImg"+ i).html(imgSrc);	
					$("#devBdBigTitle"+ i).html( $(this).attr("alt") );						
				});
			});

		});

	})(jQuery)	
	
	// °ü½É±â¾÷ µî·Ï gi_info_read.asp
	var go_favor = function(pType){

		if (mid == "") {
			if (confirm("'°ü½É±â¾÷µî·Ï'Àº °³ÀÎÈ¸¿ø ·Î±×ÀÎ ÈÄ »ç¿ë°¡´É ÇÕ´Ï´Ù.\n\nÁö±Ý ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")) {
				var re_url = "/List_GI/GI_Info_Read.asp?C_ID="+cid;
				top.location.href="/Login/Login_GG.asp?re_url=" + escape(re_url);
			}
		}
		else {
				jQuery.ajax({
					url : "/Text_User/GG_FavorCo_Reg_Check.asp",
					type : "get",
					data : "M_ID="+mid+"&C_ID="+cid, 
					dataType : "html",  
					contentType: 'application/json;',
					cache: false,			
					success : function(data){
						if (data == "Y")
						{
							alert("ÀÌ¹Ì °ü½É±â¾÷À¸·Î µî·ÏµÇ¾ú½À´Ï´Ù.");
						}else{
							var go_url ="/Text_User/GG_FavorCo_Reg.asp?C_ID="+cid+"&C_Name=" + cname+"&pType=" + pType;
							window.open(go_url,'FavorCo','width=300,height=230,toolbar=0,scrollbars=yes,resizable=no');
						}
				   }
				});	
		}
	}

	// °ü½É±â¾÷ µî·Ï booth_gi_info_read.asp
	var go_favor_booth = function(pType){

		if (mid == "") {
			alert("'°ü½É±â¾÷µî·Ï'Àº °³ÀÎÈ¸¿ø ·Î±×ÀÎ ÈÄ »ç¿ë°¡´É ÇÕ´Ï´Ù.")			
		}
		else {
				jQuery.ajax({
					url : "/Text_User/GG_FavorCo_Reg_Check.asp",
					type : "get",
					data : "M_ID="+mid+"&C_ID="+cid, 
					dataType : "html",  
					contentType: 'application/json;',
					cache: false,			
					success : function(data){
						if (data == "Y")
						{
							alert("ÀÌ¹Ì °ü½É±â¾÷À¸·Î µî·ÏµÇ¾ú½À´Ï´Ù.");
						}else{
							var go_url ="/Text_User/GG_FavorCo_Reg.asp?C_ID="+cid+"&C_Name=" + cname+"&pType=" + pType;
							window.open(go_url,'FavorCo','width=300,height=230,toolbar=0,scrollbars=yes,resizable=no');
						}
				   }
				});	
		}
	}

	// ±â¾÷Á¤º¸ ¼öÁ¤¿äÃ»
	var go_Request = function(){
		if (mid == "" && cid_js == "") {
			if (confirm("'±â¾÷Á¤º¸ ¼öÁ¤¿äÃ»'Àº °³ÀÎ ¶Ç´Â ±â¾÷È¸¿ø ·Î±×ÀÎ ÈÄ »ç¿ë°¡´É ÇÕ´Ï´Ù.\n\nÁö±Ý ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")) {
				var re_url = "/List_GI/GI_Info_Read.asp?C_ID="+cid;
				top.location.href="/Login/Login_GG_GI.asp?re_url=" + escape(re_url);
			}
		}else{
			CC_Pop('/List_Gi/Gi_info_Read_Request.asp?C_ID='+cid,'780','390');
		}	
	}
	
	//ÀÏ¹Ý Ã¤¿ëÁ¤º¸º¸±â
	function GIBRead(GI_No) {
		top.location.href = "/List_GI/GIB_Read.asp?GI_No="+GI_No;
	}

	function go_Hyup(loc,C_No) {
		var loc = "<b>" + loc + "</b>";
		//top.location.href = "/List_GI/Hyup_Dangi/Hyup_Part_Info.asp?loc=" + escape(loc) + "&C_No=" + C_No ;
		window.open("/List_GI/Hyup_Dangi/Hyup_Part_Info.asp?loc=" + escape(loc) + "&C_No=" + C_No,'win_home');
	}

	//ÇùÈ¸Á¤º¸
	function Hyup_Info(a,b,c){
		window.open("/List_Gi/Hyup_Dangi/Hyup_Info.asp?C_No="+a ,"newWin_001",'toolbar=no, location=no,directories=no,status=no,scrollbars=yes,menubar=no,width=' + b + ',height=' + c );
	}

	function go_Dangi(loc,C_No) {
		var loc = "<b>" + loc + "</b>";
		//top.location.href = "/List_GI/Hyup_Dangi/Dangi_Part_Info.asp?loc=" + escape(loc) + "&C_No=" + C_No ;
		window.open("/List_GI/Hyup_Dangi/Dangi_Part_Info.asp?loc=" + escape(loc) + "&C_No=" + C_No,'win_home2');
	}

	//´ÜÁöÁ¤º¸
	function Dangi_Info(a,b,c){
		window.open("/List_Gi/Hyup_Dangi/Dangi_Info.asp?C_No="+a ,"newWin_001",'toolbar=no, location=no,directories=no,status=no,scrollbars=yes,menubar=no,width=' + b + ',height=' + c );
	}

	function korchamView(C_Ident) {
		var linkpage = "korchamView.asp?compno="+C_Ident
		window.open(linkpage,'kcview','width=680,height=600, toolbar=0,scrollbars=yes,resizable=no');
		return;
	}

	function goHomePage(home) {
		window.open("/List_GI/Co_HomePage_Open.asp?home="+home,'win_home');
	}


	function CC_Pop(a,b,c){
		today = new Date()
		var win_name = "popDialog" + today.getTime()
		OpenWin = window.open( a ,win_name,'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,width=' + b + ',height=' + c );
	}

	//¸µÅ©°æ·Î ¼û±â±â
	function StatusHidden() {
		window.status = "ÀâÄÚ¸®¾Æ - ¸®Å©·çÆÃ ³×Æ®¿öÅ© JOBKOREA.CO.KR";
		setTimeout("StatusHidden()", 0);
	}
	StatusHidden();

	function ImageView(cid,name,title,type,img_no) {
		var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1 
		if (ie || document.getElementById)
		{ 
			var PhotoMmcLayY = document.getElementById("PhotoMmcLay").offsetTop;;
			var viewpage = "/List_GI/Photo_CompayInfo.asp?C_ID="+cid+"&IMG_Name="+name+"&IMG_Title="+title+"&IMG_Type="+type+"&img_no="+img_no+"&Re_Host=http://www.jobkorea.co.kr";
			if(navigator.appVersion.indexOf("MSIE 6")!=-1)
			{
				document.getElementById("GIphotoIfrm").style.width = "630px";
			}				
			document.getElementById("GIphotoIfrm").src = viewpage;
			document.getElementById("GIphoto_process").style.position = "absolute";
			document.getElementById("GIphoto_process").style.top = parseInt(PhotoMmcLayY) + 20 + "px";
			document.getElementById("GIphoto_process").style.left = "20px";
			document.getElementById("GIphoto_process").style.zindex = "500";
			document.getElementById("GIphoto_process").style.display = "block";
		}
		else if (document.layers)
		{ 
			var PhotoMmcLayY = document.PhotoMmcLay.offsetTop;;
			var viewpage = "/List_GI/Photo_CompayInfo.asp?C_ID="+cid+"&IMG_Name="+name+"&IMG_Title="+title+"&IMG_Type="+type+"&img_no="+img_no+"&Re_Host=http://www.jobkorea.co.kr";
			if(navigator.appVersion.indexOf("MSIE 6")!=-1)
			{
				document.GIphotoIfrm.width = "630px";
			}	
			document.GIphotoIfrm.src = viewpage;
			document.GIphoto_process.position = "absolute";
			document.GIphoto_process.top = parseInt(PhotoMmcLayY) + 320 + "px";
			document.GIphoto_process.left = "80px";
			document.GIphoto_process.zindex = "500";
			document.GIphoto_process.display = "block";
		}
	}

	//Áñ°ÜÃ£±â
	function bookmarksite(title,url) { 
	  if (window.sidebar) // firefox 
	  window.sidebar.addPanel(title, url, ""); 
	  else if(window.opera && window.print) 

	  { // opera 
		  var elem = document.createElement('a'); 
		  elem.setAttribute('href',url); 
		  elem.setAttribute('title',title); 
		  elem.setAttribute('rel','sidebar'); 
		  elem.click(); 
	  } 

	  else if(document.all) // ie 
	  window.external.AddFavorite(url, title); 
	} 
