//Äá³ª¹° ¹Ù·Î°¡±â
function fComm_GoMap( argMAPID ) {

	var targetURL = "http://www.mapid.net/" + argMAPID ;
	var windowName= "mapid" ;
	var aw = 0;
	var ah = 0;
	var TopAndLeft = "";
	if( aw == 0 ) {
		aw = screen.availwidth - 10;
		ah = screen.availheight- 30;
		TopAndLeft = ",top=0,left=0"
	}
	var windowProp= "width="   +aw +",height="+ah
			+ TopAndLeft + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";
	wid = window.open( targetURL, windowName , windowProp );
	wid.focus();
}
	
	
function fComm_GoImg(argURL,argSUBJECT,argWIDTH,argHEIGHT){

		var sORG_WIDTH;
		var sORG_HEIGHT;
		var sWIDTH;
		var sHEIGHT;
		var sIS_SCROLL;
		
		sWIDTH = 0;
		sHEIGHT = 0;
		sORG_WIDTH = argWIDTH * 1;
		sORG_HEIGHT = argHEIGHT * 1;
		sIS_SCROLL = "no";
		
		if(sORG_WIDTH <1000)
			sWIDTH = sORG_WIDTH;
		else
			sWIDTH = 1000;

		sORG_HEIGHT = ((sWIDTH * sORG_HEIGHT) / sORG_WIDTH) * 1;		//alert("sWIDTH:"+sWIDTH);
		
		if (window.screen.height * 1 < sORG_HEIGHT + 150) {
			sHEIGHT = window.screen.height - 170;
			sIS_SCROLL = "yes";
		}else{
			//sHEIGHT = sORG_HEIGHT + 120;
			sHEIGHT = sORG_HEIGHT;
		}

		//var win = window.open('/popup/pop_photo.php?hIMG_URL=' + argURL + '&hTITLE=' + argSUBJECT + '&hWIDTH=' + argWIDTH + '&hHEIGHT=' + argHEIGHT, 'viewpict', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + sIS_SCROLL + ',resizable=no,left=50,top=50,width=' + sWIDTH + ',height=' + sHEIGHT);
		//win.focus();
		if (sIS_SCROLL == "yes"){
			sORG_WIDTH = sWIDTH;
			sWIDTH = sWIDTH + 17;
		}else{
			sORG_WIDTH = sWIDTH;
		}
		
		window.open('/popup/pop_photo.php?hIMG_URL=' + argURL + '&hTITLE=' + argSUBJECT + '&hWIDTH=' + sORG_WIDTH + '&hHEIGHT=' + argHEIGHT, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + sIS_SCROLL + ',resizable=yes,left=50,top=50,width=' + sWIDTH + ',height=' + sHEIGHT);
		
	}


 function fComm_resizeHeight(fr) {
	var Frame_Body  = document.frames(fr).document.body;
	var Frame_name  = document.all(fr);
	Frame_name.style.height = Frame_Body.scrollHeight + (Frame_Body.offsetHeight-Frame_Body.clientHeight);
}



//¾Æ·¡·Î ÆîÃÄÁö´Â Å×±×
var old_menu = '';
function menuclick(num) {
	var submenu = eval('prdPar_' + num);

	if(old_menu != submenu) {
		if(old_menu != '') old_menu.style.display = 'none';
		submenu.style.display = 'block';
		old_menu = submenu;
	} else {
		submenu.style.display = 'none';
		old_menu = '';
	}
}




//±Û ¼ýÀÚ·Î¸¸ ¹ÞÀ½.
//style="ime-mode:disabled" onkeypress="javascript:GetKey();"
function GetKey()
{
	if (event.keyCode >= 48 && event.keyCode <= 57) {
	  event.returnValue = true;
	  }
	else {
	  event.returnValue = false;
	  }
}


function fCatalogPop(url,_width,_height) 
{ 
	if(_width);else _width=1000;
	if(_height);else _height=700;
	
	 
	
         if(window.clientInformation.userAgent.indexOf("SV1")>0){
        newWin = window.open(url,"","toolbar=no location=no directories=no status=no menubar=no scrollbars=no resizable=yes width=1024 height=768 top=0 left=0");
            newWin.moveTo(0,0);

                left1=(screen.availWidth-1024-5)/2; 
            top1=(screen.availHeight-768-10)/2; 
            
                newWin.resizeTo(1024,812);
                newWin.moveTo(left1,top1);

    }else{
            if(screen.width==_width&&screen.height==_height) { 
                window.open(url,"","fullscreen"); 
              } else { 
            left1=(screen.availWidth-1024-5)/2; 
            top1=(screen.availHeight-768-10)/2;       
            window.open(url,"","toolbar=no location=no directories=no status=no menubar=no scrollbars=no resizable=yes width=1024 height=768 top="+top1+" left="+left1); 
              }
        }
}


function fComm_TEL_INFO() {
	var wid;
	
	wid = window.open("/customer/c_inquiry_tel_popup.php", "TEL_INFO", "width=592,height=502,left=50,right=50,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
	wid.focus();
}

function fComm_Favorite(argUSER_ID, argPROJECT_ID, argURL) {
	var win;
	
	if (argUSER_ID < 1) {
		alert("·Î±×ÀÎÈÄ ÀÌ¿ëÇÏ¼¼¿ä.");
		document.location = "/member/m_login.php?hURL_SS_S=" + argURL;
		return;
	}
	
	win = window.open("/popup/pop_favorite.php?hPROJECT_ID=" + argPROJECT_ID,'pop_favorite','width=390,height=80,toolbar=no,menubar=no,scrollbars=no'); 
	win.focus();
}


function fComm_ContractInfo() {
	var w_contract_info;
	w_contract_info=window.open('http://218.237.5.130/webslms/slms6400/slms6420/slms6420.wcs','w_contract_info','width=1024,height=768');
	w_contract_info.focus();
	
}


//ÀÌ¾ÈÇöÀå.. °øÁ¤½Ã¹Ä·¹ÀÌ¼Ç ÆË¾÷Ã¢ ¶ç¿ì´Â ÇÔ¼ö.
function fPopSimul()	{
	var wPOP=window.open('simulation.htm','simul','top=0, left=0, width=800, height=660')
	wPOP.focus();
}	



//iframe window resize
function resizeFrame() {
	self.resizeTo(document.body.scrollWidth,document.body.scrollHeight);
}


//ÁÖ¹Î¹øÈ£Ã¼Å©
function checkJumin(hJUMIN1, hJUMIN2) {
		var rn;
		rn=hJUMIN1 + hJUMIN2;
		var sum=0;
		for(i=0;i<8;i++) { sum+=rn.substring(i,i+1)*(i+2); }
		for(i=8;i<12;i++) { sum+=rn.substring(i,i+1)*(i-6); }
		sum=11-(sum%11);
		if (sum>=10) { sum-=10; }
		if (rn.substring(12,13) != sum || (rn.substring(6,7) !=1 && rn.substring(6,7) != 2)) {
			alert("ÁÖ¹Îµî·Ï¹øÈ£¿¡ ¿À·ù°¡ ÀÖ½À´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ê½Ã¿À.");
			return;
		} else {
			return;
		}


}




 function fonlyNumber(){

 //48~57
 //alert(event.keyCode);
 	if ((event.keyCode<48) || (event.keyCode >57)){
		if (event.keyCode != 13)
		{
		  		event.returnValue=false;
		}

 	}
}



/*
 * Fucntion Name : trim()
 * Desc			: ¹®ÀÚ¿­ °ø¹éÁ¦°Å

 * Use			: strVariable.trim(); 
*/
String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, "");
}



/*
 Äí±â°ª °¡Á®¿À±â
*/
function getCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ) {
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie )    {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";

}

/*
 Äí±â¼ÂÆÃ
*/
function setCookie(name, value, expiredays) {
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expiredays);
	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


//ºÎµ¿»ê ´º½º¸µÅ©
function estate_news(url) {
	location.href="/information/news.php?hURL=" + url;
}


function commAllCheck(obj, checkObj, value) {
	if (value == null) value = obj.checked;
	
	if (checkObj != null)	{
		if (checkObj.length == null){	// 1°³¸¸ ¹ß°ßµÊ
			checkObj.checked = value;
		}else{	// ¿©·¯°³ ¹ß°ßµÊ
			for (i = 0; i < checkObj.length; i++){
				checkObj[i].checked = value;
			}
		}
	}
}
