document.title = "::: È¸¿ø±Ç °Å·¡ÀÇ ÆÄÆ®³Ê Áß¾ÓÈ¸¿ø±Ç¿¡ ¿À½Å°ÍÀ» È¯¿µÇÕ´Ï´Ù.:::";
document.write("<script type='text/javascript' src='/js/common_url.js'></script>");

String.prototype.ltrim = function(){
	var re = /\s*((\S+\s*)*)/;
	return this.replace(re, "$1");
}

String.prototype.rtrim = function(){
	var re = /((\s*\S+)*)\s*/;
	return this.replace(re, "$1");
}

String.prototype.trim = function(){
	return this.ltrim().rtrim();
}


/* history (path) */
function link(){
	var url = "";
	var depth = arguments.length;
	try {
		if(depth==0) return;
		else for(i=0;i<depth;i++) url += ((i==0)?"u":"_") + arguments[i];
		url = eval(url)[0];
		if(url=="") {
			alert("ÁØºñÁßÀÔ´Ï´Ù.");
		}else{
			//alert(arguments[0]);
			/*
			if(arguments[0]==10){
				//location.target = "_blank";
				//location.href = url
				window.open(url, 'new', 'width=1024,height=700,scrollbars=auto,toolbar=yes,menubar=yes');
			}else{
				location.href = url;
			}
			*/

			location.href = url;
		}
	}catch(e) { alert(e.message); }
}

/* popup */
function openPop(url, n, stat){
	var win = window.open(url, n, stat);
}


/* ½Ã¼¼µ¿Çâ */
function goMarket(num, idx){
	//alert(num);
	if(num==8){
		opener.parent.location.reload("/membership/membership_market_view.html?btm_idx="+num+"&idx="+idx);
	}else if(num==25){
		opener.parent.location.reload("/condo/condo_market_view.html?btm_idx="+num+"&idx="+idx);
	}else if(num==26){
		opener.parent.location.reload("/condo/fitness_market_view.html?btm_idx="+num+"&idx="+idx);
	}
	opener.parent.focus();
	self.close();
}


/* skyScrapper */

var topLimit = new Array();
var bottomLimit = new Array();
var speed = new Array();
var QuickMenu = new Array();

function initSkyScrapper(id, top, bottom) {
	if (document.getElementById) {
		topLimit[id] = top;
		bottomLimit[id] = bottom;
		speed[id] = arguments[3]?arguments[3]:10;
		QuickMenu[id] = document.getElementById(id);
		QuickMenu[id].style.top = topLimit[id];
		QuickMenu[id].style.visibility = "visible";
		moveSkyScrapper(id);
	}
}

function moveSkyScrapper(id) {
	var yMenuMax, yMenuFrom, yMenuTo, yOffset;

	yMenuMax = document.body.scrollHeight - QuickMenu[id].scrollHeight-bottomLimit[id];
	yMenuFrom   = parseInt (QuickMenu[id].style.top, 0)-topLimit[id];
	yMenuTo     = (window.pageYOffset || document.body.scrollTop);
	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / speed[id]);
		if (yMenuTo < yMenuFrom)  yOffset = -yOffset;
		QuickMenu[id].style.top = parseInt (QuickMenu[id].style.top, 0) + yOffset;
		if(yMenuMax < parseInt (QuickMenu[id].style.top, 10)) QuickMenu[id].style.top = yMenuMax;
	}
	setTimeout ("moveSkyScrapper('"+id+"')", 10);
}
/* skyScrapper end */


// ÁÖ¼Ò °Ë»ö °á°ú¸¦ ¿ÀÇÂÇÑ ÆäÀÌÁö·Î µ¹·ÁÁÖ°í, °Ë»öÃ¢À» ´Ý´Â´Ù.
function ResultZipcode( zip1 , zip2 , addr, type ) {
	if (type == "1")	{
		opener.document.form1.zip01.value=zip1;
		opener.document.form1.zip02.value=zip2;
		opener.document.form1.addr01.value=addr;
		opener.document.form1.addr02.focus();
	} else if (type == "2")	{
		opener.document.form1.jobzip01.value=zip1;
		opener.document.form1.jobzip02.value=zip2;
		opener.document.form1.jobaddr01.value=addr;
		opener.document.form1.jobaddr02.focus();
	}
	window.close();
}


//¼ýÀÚ¸¸ ÀÔ·ÂÆû Ã¼Å©
function isNumber(obj){
	var ff=eval(obj);

	for(var i=0;i<ff.value.length;i++){
		var chr=ff.value.substr(i,1);

		if(chr<'0'||chr>'9'){
			return false;
		}
	}

	return true;
}

// ¾Æ¾ÆµðÃ¼Å© ( ¼ýÀÚ,¾ËÆÄºª¸¸ °¡´É )
function IsID(form) {
	if (form.value.length < 6 || form.value.length > 12 ) return false;
		
	for ( var i=0 ; i < form.value.length ; i++ ) {
		var chr = form.value.substr(i,1);
		if ( ( chr < '0' || chr > '9' ) && ( chr < 'a' || chr > 'z' ) && ( chr < 'A' || chr > 'Z' )) return false;
	}
	return true;
}

// ÆÐ½º¿öµåÃ¼Å© ( ¼ýÀÚ,¾ËÆÄºª¸¸ °¡´É )
function IsPW(form) {
	if (form.value.length < 6 || form.value.length > 12 ) return false;

	for ( var i=0 ; i < form.value.length ; i++ ) {
		var chr = form.value.substr(i,1);
		if ( ( chr < '0' || chr > '9' ) && ( chr < 'a' || chr > 'z' ) && ( chr < 'A' || chr > 'Z' ) ) return false;
	}
	return true;
}


//ÀÌ¸ÞÀÏ Æû Ã¼Å©
function chkMail(obj){		//¾ÆÀÌµð ºÎºÐÃ¼Å©
	var ob = eval(obj);

	if(ob.value!=""){
		aIndex = ob.value.indexOf("@");
		dotIndex = ob.value.indexOf(".");

		//alert(aIndex);

		//if(aIndex==-1 || dotIndex==-1 || aIndex>=(dotIndex-1)){
		if(aIndex!=-1 || dotIndex!=-1){
		//if(dotIndex==-1){
			//alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			//ob.focus;
			//return;

			return true;
		}
	}
}

function chkMail2(obj){		//µµ¸ÞÀÎºÎºÐÃ¼Å©
	var ob = eval(obj);

	if(ob.value!=""){
		//aIndex = ob.value.indexOf("@");
		dotIndex = ob.value.indexOf(".");

		//if(aIndex==-1 || dotIndex==-1 || aIndex>=(dotIndex-1)){
		if(dotIndex==-1){
		//if(dotIndex==-1){
			//alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			//ob.focus;
			//return;

			return true;
		}
	}
}


// ±×¸² ÀÌ¹ÌÁö ºñ·Ê Á¶Á¤
   function func_adjustimage(target_img, w, h)
   {
      var newX;
      var newY;
      var newHeight;
      var newWidth;
      var maxWidth = w;
      var maxHeight = h;
      var newImg = new Image();
      newImg.src = target_img.src;
      imgw = newImg.width;
      imgh = newImg.height;
      if (imgw > maxWidth || imgh > maxHeight)
      {
         if (imgw/maxWidth > imgh/maxHeight)
         {
            if (imgw > maxWidth)
               newWidth = maxWidth;
            else
               newWidth = imgw;
            newHeight = Math.round((imgh * newWidth) / imgw);
         }
         else
         {
            if (imgh > maxHeight)
               newHeight = maxHeight;
            else
               newHeight = imgh;
            newWidth = Math.round((imgw * newHeight) / imgh);
         }
      }
      else
      {
         newWidth = imgw;
         newHeight = imgh;
      }
       newX = maxWidth / 2 - newWidth / 2;
       newY = maxHeight / 2 - newHeight / 2;
       target_img.onload = null;
       target_img.src = newImg.src;
       target_img.width = newWidth;
       target_img.height = newHeight;
   }




// ÆùÆ® »çÀÌÁî Á¶Àý

defsize = 12;  //±âº» Å©±â ¼³Á¤


function zoom_it(n) {  //zoom_it ÇÔ¼ö => n ¸¸Å­ ¾ç¼ö´Â ±Û²ÃÀ» Å©°Ô À½¼ö´Â ÀÛ°Ô
	if(n>0){
		if(defsize<20){

			  defsize+=n;    //±âº» Å©±â(defsize)¿¡ nÀ» ´õÇØ¼­ defsize¿¡ ÀúÀå

			 // objs = document.getElementsByTagName("td");  //tdÅÂ±×µéÀ» ¸ðÁ¶¸® objs¿¡ ÀúÀå
			 objs = document.getElementById('content-area').getElementsByTagName("td");

			  for(i=0;i<objs.length;i++){ //objs¿¡ ÀúÀåµÈ tdÅÂ±×µéÀÇ °¢°¢ÀÇ ½ºÅ¸ÀÏÀÇ ±Û²ÃÅ©±â ¼³Á¤
				
				objs[i].style.fontSize=defsize + "px";  //fontSize´Â ´ÜÀ§¸¦ ÀÔ·ÂÇØ Áà¾ß ÇÔ. pt , px µî
				lineHeight = defsize+5;
				objs[i].style.lineHeight=lineHeight + "px";
			  }
		}
	}else if(n==0){
		defsize=12;
		objs = document.getElementById('content-area').getElementsByTagName("td");

		  for(i=0;i<objs.length;i++){ //objs¿¡ ÀúÀåµÈ tdÅÂ±×µéÀÇ °¢°¢ÀÇ ½ºÅ¸ÀÏÀÇ ±Û²ÃÅ©±â ¼³Á¤
			
			objs[i].style.fontSize=12 + "px";  //fontSize´Â ´ÜÀ§¸¦ ÀÔ·ÂÇØ Áà¾ß ÇÔ. pt , px µî
			lineHeight = 12+5;
			objs[i].style.lineHeight=lineHeight + "px";
		  }
	}else{
		if(defsize>11){

			  defsize+=n;    //±âº» Å©±â(defsize)¿¡ nÀ» ´õÇØ¼­ defsize¿¡ ÀúÀå

			 // objs = document.getElementsByTagName("td");  //tdÅÂ±×µéÀ» ¸ðÁ¶¸® objs¿¡ ÀúÀå
			 objs = document.getElementById('content-area').getElementsByTagName("td");

			  for(i=0;i<objs.length;i++){ //objs¿¡ ÀúÀåµÈ tdÅÂ±×µéÀÇ °¢°¢ÀÇ ½ºÅ¸ÀÏÀÇ ±Û²ÃÅ©±â ¼³Á¤
				
				objs[i].style.fontSize=defsize + "px";  //fontSize´Â ´ÜÀ§¸¦ ÀÔ·ÂÇØ Áà¾ß ÇÔ. pt , px µî
				lineHeight = defsize+5;
				objs[i].style.lineHeight=lineHeight + "px";
			  }
		}
	}

}
