<!--

//****************************************************************************************
// ¹®ÀÚ¿­ Á¤±Ô½Ä Trim ÇÔ¼ö
// Ex) str = "    Å× ½ºÆ®   ".trim(); => str = "Å× ½ºÆ®";
//****************************************************************************************
String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, "");
}


// ¹®ÀÚ¿­ °ø¹éÁ¦°Å ÇÔ¼ö ##################################################
// Ex) str = "    Å× ½º   Æ®   ".stripspace(); => str = "Å×½ºÆ®";
String.prototype.stripspace = function() {
	return this.replace(/ /g, '');
}


//À¥Áø ¹Ù·Î°¡±â
function fComm_GoWebzine() {
	//argKIND : FIELD,SALE 
	var wWEBZINE;
	var strURL="/webzine/index.asp" ;
	
	wWEBZINE=window.open(strURL,'wWEBZINE');
  wWEBZINE.focus();
   
	}

//À¥Áø ¹Ù·Î°¡±â
function fComm_GoWebzine_URL(argURL) {
	//argKIND : FIELD,SALE 
	var wWEBZINE;
	
	wWEBZINE=window.open(argURL,'wWEBZINE');
  wWEBZINE.focus();
   
	}

//À¥Áø ¹Ù·Î¶ç¿ì±â
function fGoWebzine() {
    cw = screen.availWidth;  // È­¸é ³Êºñ
    ch = screen.availHeight; // È­¸é ³ôÀÌ

    sw = 1024; // ¶ç¿ï Ã¢ÀÇ ³Êºñ
    sh = 692;// ¶ç¿ï Ã¢ÀÇ ³ôÀÌ

    ml = (cw-sw)/2;// °¡¿îµ¥ ¶ç¿ì±âÀ§ÇÑ Ã¢ÀÇ xÀ§Ä¡
    mt = (ch-sh)/2;// °¡¿îµ¥ ¶ç¿ì±âÀ§ÇÑ Ã¢ÀÇ yÀ§Ä¡

	//if (getCookie("main") != "done") {
	NewWindow = window.open('/webzine/200811/main.asp?pageNum=', 'popup1','width='+sw+',height='+sh+',top='+mt+',left='+ml+',toobar=no,scrollbar,menubar=no');
	//}
}



//ºÎ¸ðÀ©µµ¿ì·Î µ¹¾Æ°¡±â
function fComm_GoParentWin(argURL)
{
		if (window.name=="") {
				win_mother = window.open(argURL,"win_mother"); 
				win_mother.focus();
				
				return;
		}
		//alert(argURL);
		//return;
		var win_mother;
		//if(eval(opener.window.focus())) //ºÎ¸ð°¡Á¸ÀçÇÏ¸é
		if(!opener.closed) //ºÎ¸ð°¡Á¸ÀçÇÏ¸é
		{
		//alert("000");
				win_mother =opener.window;
				win_mother.location=argURL ;
				win_mother.focus();
		}
		else
		{
		//alert("111");
				win_mother = window.open(argURL,"win_mother"); 
				win_mother.focus();
		}
}



//Äá³ª¹° ¹Ù·Î°¡±â
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){
	document.frmFORM.target = "ifm";
	document.frmFORM.action = "/include/popup/popup_img_size.asp?hPATH="+ argURL + "&hSUBJECT="+argSUBJECT;
	document.frmFORM.submit();
}



//¾Æ·¡·Î ÆîÃÄÁö´Â Å×±×
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 fGoM2CALC()
{
	var win = window.open('/siteinfo/popup.asp', 'pop_house', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=50,top=50,width=360,height=270');
	win.focus();
	return ;
}

// ÁÂÃø ¹Ý¿Ã¸²Æ÷ÀÎÆ® È£ÃâÇÔ¼ö
function fGoLeftPoint()
{
	location.href = "/thesharp/t_p_info.asp";
}


function fonlyNumber(){
//48~57
//alert(event.keyCode);
	if ((event.keyCode<48) || (event.keyCode >57)){
		event.returnValue=false;
	}

  	if(event.keyCode == 13){
      fRealNameGo();
    }
}

function fTAP_ORDER() {  
	var f
	
	f=document.frmMEMBER ;

	if (f.hJUMIN1.value.length==6) {
		f.hJUMIN2.focus() ;
		return;
	}
}  
function fTAP_ORDER2() {  
	var f

	f=document.frmMEMBER ;

	if (f.hJUMIN2.value.length==7) {
		f.hPASSWORD.focus() ;
		return;
	}
}  




//¼ýÀÚ¸¸ ÀÔ·ÂµÇµµ·ÏÇÏ´Â ÇÔ¼ö.
function CheckNumeric(Data) {
	var nochk='01234567890'
	for (i=0; i<Data.length; i++){
		if(nochk.indexOf(Data.substring(i,i+1)) < 0) 		
		{
			return false;
		}
	}//for Á¾·á
	return true;
}

// ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ±â.
function NumNock(){
	if ((event.keyCode<48)||(event.keyCode>57)){ 
		event.returnValue = false;
	}
	return true;
}

// ¼ýÀÚ¿¡ ÄÞ¸¶Âï±â.
function WonAmount(NumV)
{
	Num = NumV.toString();

	var count     = 0;
	var temp      = "";
	var resultWon = "";
	var oneChar   = "";

	for (var ch = Num.length-1; ch >= 0; ch--)
	{ 
		oneChar = Num.charAt(ch);

		if (count == 3) 
		{
			temp += ",";
			temp +=
			oneChar;
			count = 1;
			continue;
		} 
		else 
		{
			temp +=
			oneChar;
			count ++;
		}
	}

	for (var ch = temp.length-1; ch >= 0; ch--)
	{ 
		oneChar =temp.charAt(ch);
		resultWon += oneChar;
	}
	return resultWon;
}



//°ø¹éÃ¼Å©
function isEmpty( data ){
	for ( var i = 0 ; i < data.length ; i++ ){
		if ( data.substring( i, i+1 ) != " " ){
			return true;
		}
	}
	return false;
}

//ÀÌ¹ÌÁöÃ¼Å©
function CheckImg(Data)
{
	if ( Data.indexOf(".JPG") != -1 || Data.indexOf(".GIF") != -1 || Data.indexOf(".gif") != -1 || Data.indexOf(".jpg") != -1 ){
		return true;
	}
	return false;
}

// ÀÌ¸ÞÀÏ Ã¼Å©
function email_chk(tempf)
{
	var t = tempf
	var ValidFlag = false
	var atCount = 0
	var SpecialFlag
	var atLoop
	var atChr
	var BadFlag
	var tAry1
	var UserName
	var DomainName

	if ( t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0 ) {
		atCount = 0
		SpecialFlag = false

		for( atLoop=1; atLoop<=t.length; atLoop++ ) {
			atChr = t.substring( atLoop, atLoop+1 )
			if ( atChr == "@" ) atCount = atCount + 1

			if ( (atChr >= 32) && (atChr <= 44) ) SpecialFlag = true 
			if ( (atChr == 47) || (atChr == 96) || (atChr >= 123) ) SpecialFlag = true 
			if ( (atChr >= 58) && (atChr <= 63) ) SpecialFlag = true 
			if ( (atChr >= 91) && (atChr <= 94) ) SpecialFlag = true 
		}

		if ( ( atCount == 1 ) && (SpecialFlag == false ) ) {
			BadFlag = false
			tAry1 = t.split("@")
			UserName = tAry1[0]
			DomainName = tAry1[1]
			if ( (UserName.length <= 0 ) || (DomainName.length <= 0 ) ) BadFlag = true
			if ( DomainName.substring( 1, 2 ) == "." ) BadFlag = true
			if ( DomainName.substring( DomainName.length-1, DomainName.length) == "." ) BadFlag = true
			ValidFlag = true
		}
	}
	if ( BadFlag == true ) ValidFlag = false
	return ValidFlag
}


// ÁÖ¹Î¹øÈ£ Ã¼Å©
function Jumin_chk(it) {
	IDtot = 0;
	IDAdd = "234567892345";

	for(i=0; i<12; i++) IDtot = IDtot + parseInt(it.substring(i, i+1)) * parseInt(IDAdd.substring(i, i+1));
	IDtot = 11 - (IDtot%11);
	if (IDtot == 10) IDtot = 0;
	else if (IDtot == 11) IDtot = 1;
	if(parseInt(it.substring(12, 13)) != IDtot) return true;
	else return false
}

// ¿µ¹® ¼ýÀÚ¸¸ ÀÔ·Â°¡´É

function checkEN(str){ 
	var check = 'abcdefghijklmnopqrstuvwxyz0123456789_-';
	var temp; 
	for (var i=0; i<str.length; i++) { 
		temp = '' + str.substring(i, i+1); 
		if (check.indexOf(temp) == '-1'){ 
			return false;
		}
	} 
	return true;
}


// ¹Ìµð¾î ÇÃ·¹ÀÌ¾î 
function fPlayer_Activate(argWIDTH, argHEIGHT, argPLAYER_URL) {

	var contents = "<OBJECT id='mediaPlayer' type='application/x-oleobject' standby='Loading Microsoft?Windows?Media Player components...'"
		contents += " width= " + argWIDTH + " height= " + argHEIGHT + " classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95'>" 
		contents += " <PARAM NAME='FileName' VALUE=" + argPLAYER_URL + "> "
		contents += " <PARAM NAME='AnimationAtStart' VALUE='false'> "
		contents += " <PARAM NAME='TransparentAtStart' VALUE='true'> "
		contents += " <PARAM NAME='AutoStart' VALUE='true'> "
		contents += " <PARAM NAME='Autosize' VALUE='false'> "
		contents += " <PARAM NAME='AutoRewind' VALUE='true'> "
		contents += " <PARAM NAME='ShowDisplay' VALUE='false'> "
		contents += " <PARAM NAME='ShowStatusBar' VALUE='false'> "
		contents += " <PARAM NAME='ShowControls' VALUE='false'> "
		contents += " <PARAM NAME='ShowAudioControls' VALUE='false'> "
		contents += " <PARAM NAME='ShowTracker' VALUE='false'> "
		contents += " <PARAM NAME='ShowPositionControls' VALUE='0'> "
		contents += " <PARAM NAME='EnableContextMenu' VALUE='false'> "
		contents += " </object> ";
		document.write(contents);
}

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 fComm_GoImgView(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 (window.screen.width * 1 < sORG_WIDTH + 40) {
		sWIDTH = window.screen.width - 90
		sIS_SCROLL = "yes";
	}else{
		sWIDTH = sORG_WIDTH //+ 40
	}
	
	if (window.screen.height * 1 < sORG_HEIGHT + 144) {
		sHEIGHT = window.screen.height - 150
		sIS_SCROLL = "yes";
	}else{
		sHEIGHT = sORG_HEIGHT // + 144
	}
	
	// ½ºÅ©·Ñ ¿©ºÎ¿¡ µû¶ó width °ª ´Ù½Ã Á¶Àý
	/*
	if (sIS_SCROLL=="no")
	{
		sWIDTH = sORG_WIDTH + 40
	}
	else
	{
		sWIDTH = sORG_WIDTH + 54
	}

	
	if (sORG_WIDTH > 1000) {
		sWIDTH = 1000
		sIS_SCROLL = "yes";
	}else{
		sWIDTH = sORG_WIDTH + 40
	}
	
	if (sORG_HEIGHT > 800) {
		sHEIGHT = 800
		sIS_SCROLL = "yes";
	}else{
		sHEIGHT = sORG_HEIGHT + 144
	}
	
	// ½ºÅ©·Ñ ¿©ºÎ¿¡ µû¶ó width °ª ´Ù½Ã Á¶Àý
	if (sIS_SCROLL=="no")
	{
		sWIDTH = sORG_WIDTH + 40
	}
	else
	{
		sWIDTH = sORG_WIDTH + 54
	}
	*/

	var win = window.open('/include/inc_image_popup.asp?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=0,top=0,width=' + sWIDTH + ',height=' + sHEIGHT);
	if (win !=null)	{ win.focus();	}
}

//=================================================================================================================================
// ¾ÆÀÌÇÁ·¹ÀÓ »çÀÌÁî Á¶Àý - 20090602 Ãß°¡
//=================================================================================================================================
var memobj = new Array();
function syncheight(obj){
 if(obj){
  obj.style.height=obj.contentWindow.document.body.scrollHeight;
 }
 else{
  while(memobj.length>0){
   memobj[0].style.height=memobj[0].contentWindow.document.body.scrollHeight;
   memobj.shift();
  }
 }
}
function viewsmallframe(){
 var tmptr = event.srcElement.parentNode.parentNode.nextSibling;
 tmptr.style.display = tmptr.style.display=='none'?'':'none';
 
 memobj[memobj.length] = tmptr.cells(0).childNodes(0);
 memobj[memobj.length] = parent.document.getElementById('mainframe');
 setTimeout("syncheight()",1);
}

// Ä¿³Î¿öÅ© ÆË¾÷º¸±â.
function fViewCanalwalk()
{
	var win_canal = window.open('/popup/pop_mv.asp', 'win_canal', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=0,width=829,height=503');
	if (win_canal !=null)	{ win_canal.focus();	}
}


// ÆË¾÷Ã¢ °¡¿îµ¥ ¶ç¿ì±â.
var win = null; 
function NewWindow(mypage,myname,w,h,scroll)
{ 
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' ;
	win = window.open(mypage,myname,settings) 
	win.focus();
} 



//ÅÇ¸Þ´º ½ºÅ©¸³Æ®
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");
				} else {
					currentmenu.className = currentmenu.className.replace("on", "");
				}
			}

			this.targetEl.style.display = "block";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

//****************************************************************************************
// ÀÔ·Â ¹®ÀÚ±æÀÌ È®ÀÎÈÄ ´ÙÀ½Ç×¸ñÀ¸·Î Æ÷Ä¿½º ¿Å±â±â
//****************************************************************************************
function goNextFocus(obj, len, next_item) {
	if (obj.value.stripspace().length == len){
		next_item.focus();
	}
}

/*
	-°øÅë ·¹ÀÌ¾î ¶ç¿ì±â
	 pUrl : ·¹ÀÌ¾î ÆÄÀÏ¸í
	 w    : ·¹ÀÌ¾î width
	 h    : ·¹ÀÌ¾î height
*/

function layer(pUrl,w,h) {
	
	var innerWidth;

	nowScroll = getNowScroll();
	_close(); // ·¹ÀÌ¾î ÃÊ±âÈ­
	var divTag		= '';
	var backTag		= '';
	var iframeTag = '';
	backTag		+="<div id='backTag' style='dispaly:none;z-index:99990;background-color:#000;filter:alpha(opacity=50); opacity:0.5; -moz-opacity:0.5;'>";
	backTag		+="</div>";
	divTag		+="<div id='feedLayer' style='dispaly:none;z-index:99993;'>";
	divTag		+="</div>";
	iframeTag +="<iframe id='bkifrm' frameborder='0' style='z-index:99991;'/>"
	jQuery("body").append(backTag);
	jQuery("#backTag").show();

	var layer1 = jQuery('#backTag');

	if(navigator.appVersion.indexOf("MSIE") > -1){
		innerWidth = document.body.clientWidth;
	}
	else {
		innerWidth = window.innerWidth;
	}

	layer1.css({
		position: 'absolute'
		, top   : '0'
		, left  : '0'
		, width : innerWidth
		, height: document.body.clientHeight
		});

		//var iHeight = (document.body.clientHeight / 2) - w / 2 + document.body.scrollTop;
	var iHeight = nowScroll.Y + 200; // ½ºÅ©·Ñ À§Ä¡¿¡¼­ 200xp À§Ä¡
	var iWidth  = (document.body.clientWidth / 2) - w / 2 + document.body.scrollLeft;

	jQuery("body").append(iframeTag);
	jQuery('#bkifrm').css({
		position: 'absolute'
		, top   : iHeight
		, left  : iWidth
		, width : w
		, height: h-10
		});

	jQuery("body").append(divTag);
	jQuery("#feedLayer").show();
	var layer2 = jQuery('#feedLayer');
	layer2.load(pUrl);


	layer2.css({
		position: 'absolute'
		, top   : iHeight
		, left  : iWidth
		, width : w
		, height: h
		});
}
function _close(){
	jQuery("#feedLayer").remove();;
	jQuery("#backTag").remove();;
	jQuery("#bkifrm").remove();;
}

/*
	-½ºÅ©·Ñ À§Ä¡

*/
var getNowScroll = function(){
var de = document.documentElement;
var b = document.body;
var now = {};
now.X = document.all ? (!de.scrollLeft ? b.scrollLeft : de.scrollLeft) : (window.pageXOffset ? window.pageXOffset : window.scrollX);
now.Y = document.all ? (!de.scrollTop ? b.scrollTop : de.scrollTop) : (window.pageYOffset ? window.pageYOffset : window.scrollY);
return now;
}

/* laydrld */
 function layershow(layerId) {
  document.getElementById(layerId).style.display = "block";
 }
 function layerhide(layerId) {
  document.getElementById(layerId).style.display = "none";
}

// ÀÌ¹ÌÁö È®´ëº¸±â ·¹ÀÌ¾î.
//
function imgBiglayerSizeCk(pUrl, imgTitle)
{
	// ÇØ´çÀÌ¹ÌÁöÀÇ Å©±â¸¦ ±¸ÇÑ´Ù.
	var objPreloadImg = new Image();
	objPreloadImg.src = pUrl;
	var loadTimer;

	if (objPreloadImg.complete){
		var strAgent = navigator.userAgent.toLowerCase();
		var bIE = (strAgent.indexOf("msie") != -1);
		var bXP = (strAgent.indexOf("nt 5.1") != -1);
		var bIE7 = (strAgent.indexOf("msie 7.0") != -1);
		var bSafari = (strAgent.indexOf("konqueror") != -1 || strAgent.indexOf("safari") != -1);
		var bFirefox = (strAgent.indexOf("firefox")!= -1);
		bXP = true;	// ºê¶ó¿ìÁ® Status¹Ù À¯¹«

		var objOriginalImg = document.getElementById("orgImg");

		var imgWidth = objPreloadImg.width;
		var imgHeight = objPreloadImg.height;

		imgHeight = imgHeight + (bXP ? (bIE7 ? 40 : 20) : 0)
		
		/*
		ºê¶ó¿ìÁ® Å©±âº° Ã½
		*/
		
		var sORG_WIDTH
		var sORG_HEIGHT
		var sWIDTH
		var sHEIGHT
		var sIS_SCROLL
		
		sWIDTH = 0;
		sHEIGHT = 0;
		sORG_WIDTH = imgWidth * 1;
		sORG_HEIGHT = imgHeight * 1;
		sIS_SCROLL = "no";
		
		var screenW = window.screen.width-400;
		var screenH = window.screen.height-300;

		//ÀÌ¹ÌÁö°¡ ´õÅ©¸é.
		if (screenW * 1 < sORG_WIDTH) {
			sWIDTH = screenW
			sIS_SCROLL = "yes";
		}else{
			sWIDTH = sORG_WIDTH //+ 57
		}

		if (screenH * 1 < sORG_HEIGHT) {
			sHEIGHT = screenH
			sIS_SCROLL = "yes";
		}else{
			sHEIGHT = sORG_HEIGHT //+ 149
		}
		
		//alert(sWIDTH)
		//alert(sHEIGHT)		

		imgBiglayer(pUrl,imgTitle, sWIDTH, sHEIGHT, sIS_SCROLL);

	}
	else {
		loadTimer = setTimeout('imgBiglayerSizeCk(\"'+pUrl+'\", \"'+imgTitle+'\")', 100);
	}
}

/*
<div class='layer_zoom' id='backTag'>
<p class='close'><a href='#' onclick='layerhide('layer_zoom');'><img src='/images/common/icon_layer_close.gif' alt='' /></a></p>
<p class='title'>Á¶°¨µµ</p>
<p class='img'><img src='/images/common/img_layer.jpg' alt='' /></p>
</div>
*/

function imgBiglayer(pUrl,imgTitle,w,h,scroll) {
	var innerWidth;

	nowScroll = getNowScroll();
	_imgBigClose(); // ·¹ÀÌ¾î ÃÊ±âÈ­
	var divTag		= '';
	var backTag		= '';
	var iframeTag = '';
	backTag		+="<div id='backTag' style='dispaly:none;z-index:1000;background-color:#000;filter:alpha(opacity=10); opacity:0.5; -moz-opacity:0.5;'>";
	backTag		+="</div>";
	
	divTag		+="<div id='feedLayer' style='dispaly:none;z-index:1003;'>";
	divTag		+="</div>";
	/*
	divTag		+="	<div class='layer_zoom' id='feedLayer' style='dispaly:none;z-index:1003;'>";
	divTag		+="		<p class='close'><a href='#' onclick='layerhide('layer_zoom');'><img src='/images/common/icon_layer_close.gif' alt='' /></a></p>";
	divTag		+="		<p class='title'>Á¶°¨µµ</p>";
	divTag		+="		<p class='img'><img src='/images/common/img_layer.jpg' alt='' /></p>";
	divTag		+="	</div>";
	*/

	iframeTag +="<iframe id='bkifrm' frameborder='0' style='z-index:1001;'/>"
	jQuery("body").append(backTag);
	jQuery("#backTag").show();
	
	if(navigator.appVersion.indexOf("MSIE") > -1){
		innerWidth = document.body.clientWidth;
	}
	else {
		innerWidth = window.innerWidth;
	}
	//alert(navigator.appVersion.indexOf("MSIE"))
	var layer1 = jQuery('#backTag');
	layer1.css({
		position: 'absolute'
		, top   : '0'
		, left  : '0'
		, width :	 innerWidth
		, height: document.body.clientHeight
		});

		//var iHeight = (document.body.clientHeight / 2) - w / 2 + document.body.scrollTop;
	var iHeight = nowScroll.Y + 100; // ½ºÅ©·Ñ À§Ä¡¿¡¼­ 0xp À§Ä¡
	var iWidth  = (document.body.clientWidth / 2) - w / 2 + document.body.scrollLeft-80;

	jQuery("body").append(iframeTag);
	jQuery('#bkifrm').css({
		position: 'absolute'
		, top   : iHeight
		, left  : iWidth
		, width : w
		, height: h-10
		});

	jQuery("body").append(divTag);
	jQuery("#feedLayer").show();
	var layer2 = jQuery('#feedLayer');
	layer2.load("/include/imgBiglayer.asp?imgUrl="+pUrl+"&imgTitle="+escape(imgTitle)+"&w="+w+"&h="+h+"&s="+scroll);


	layer2.css({
		position: 'absolute'
		, top   : iHeight
		, left  : iWidth
		, width : w
		, height: h
		});
}
function _imgBigClose(){
	jQuery("#feedLayer").remove();;
	jQuery("#backTag").remove();;
	jQuery("#bkifrm").remove();;
}

// CMS ¸ÞÀÎ Áöµµ Å¬¸¯½Ã ÀÌµ¿ ÇÔ¼ö.
function openSubMap( $mainCategory , $area )
{
	var f = document.frmFORM;

	switch( $mainCategory ){
		case "1" :
			//alert('ºÐ¾çÁß ÆäÀÌÁöÀÌµ¿ - '+ $area)
			f.hFIND_STATUS.value = "ºÐ¾çÁß";	
			f.hFIND_AREA.value = $area;
			f.action = "/sales/complex_detail.asp";
			f.submit();
			break;
		case "2" :
			f.hFIND_STATUS.value = "ºÐ¾ç¿¹Á¤";	
			f.hFIND_AREA.value = $area;
			f.action = "/sales/complex_detail.asp";
			f.submit();
			break;
		break;

		case "3" :
			f.hFIND_STATUS.value = "°ø»çÁß";	
			f.hFIND_AREA.value = $area;
			f.action = "/complex/construction_detail.asp";
			f.submit();
			break;
		break;

		case "4" :
			f.hFIND_STATUS.value = "ÀÔÁÖÁß";	
			f.hFIND_AREA.value = $area;
			f.action = "/complex/move_info_detail.asp";
			f.submit();
			break;
		case "5" :
			f.hFIND_STATUS.value = "ÀÔÁÖ¿Ï·á";	
			f.hFIND_AREA.value = $area;
			f.action = "/complex/move_info_detail.asp";
			f.submit();
			break;
		break;


			//alert('ÀÔÁÖ¿¹Á¤ ÆäÀÌÁöÀÌµ¿ - '+ $area)
		break;
	}
}

//****************************************************************************************
// ÄÞ¸¶(,) Á¦°Å
//****************************************************************************************
function stripComma(str) {
	 var re = /,/g;
	 return str.replace(re, "");
}
//****************************************************************************************
// ¼ýÀÚ 3ÀÚ¸®¼ö¸¶´Ù ÄÞ¸¶(,) Âï±â
//****************************************************************************************
function formatComma(num, pos) {
	if (!pos) pos = 0;  //¼Ò¼ýÁ¡ ÀÌÇÏ ÀÚ¸®¼ö
	var re = /(-?\d+)(\d{3}[,.])/;

	var strNum = stripComma(num.toString());
	var arrNum = strNum.split(".");

	arrNum[0] += ".";

	 while (re.test(arrNum[0])) {
		  arrNum[0] = arrNum[0].replace(re, "$1,$2");
	 }

	if (arrNum.length > 1) {
		if (arrNum[1].length > pos) {
			arrNum[1] = arrNum[1].substr(0, pos);
		}
		return arrNum.join("");
	}
	else {
		return arrNum[0].split(".")[0];
	}
}

// sns ¿¬°á
function openSNSWin(openUrl, media) {
	var winObj;
	// ¿äÁòÀÎ°æ¿ì »õÃ¢.
	if (media=="yo"){
		winObj = window.open(openUrl,"sendSNSWin", 'yozmSend', 'width=466, height=356');
	}
	else{
		winObj = window.open(openUrl,"sendSNSWin","");
	}
}

function sendSNS(media, subject)	{
	var subject = "Æ÷½ºÄÚ°Ç¼³ ´õ¼¥ »çÀÌÆ®°¡ »õ·Ó°Ô ÅÂ¾î³µ½À´Ï´Ù.\n¿©·¯ºÐ ¸ðµÎ ±¸°æ ¿À¼¼¿ä.";
	var nowUrl = 'http://www.thesharp.co.kr/';

	switch(media) {
		case "tw":
			sendUrl = "http://twitter.com/share?text="+encodeURI(subject)+"&url="+nowUrl;
			openSNSWin(sendUrl, media);
			break;
		case "fa":
			sendUrl = "http://www.facebook.com/sharer.php?u="+escape(nowUrl)+"&t="+encodeURI(subject);+"&src=sp";
			openSNSWin(sendUrl, media);
			break;
		case "me":
			sendUrl = "http://me2day.net/posts/new?new_post[body]="+encodeURI(subject)+ "\":"+ escape(nowUrl) +"&new_post[tags]=" + encodeURI("Æ÷½ºÄÚ°Ç¼³ ´õ¼¥");
			openSNSWin(sendUrl, media);
			break;
		case "yo":
			sendUrl = "http://yozm.daum.net/api/popup/prePost?link="+encodeURI(nowUrl)+"&prefix="+encodeURI(subject+" "+nowUrl);
			openSNSWin(sendUrl, media);
			break;
		/*
		case "go":
			sendUrl = "http://www.google.com/bookmarks/mark?op=add&title=\"\"&bkmk="+escape(nowUrl)+"&labels=%EC%8A%A4%ED%8F%AC%EC%B8%A0%EC%A1%B0%EC%84%A0, %EB%89%B4%EC%8A%A4%EC%8A%A4%ED%81%AC%EB%9E%A9";
			openSNSWin(sendUrl);
			break;
		*/

	}
}

// ¸éÀû°è»ê±â.
function areaCalcul()
{
	layer("/etc/area_cost.asp", 350, 300);
}

//top¸µÅ©
/* Quick Menu*/
function initMoving(target) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = 126;
	obj.initLeft = 1158;
	obj.bottomLimit = document.documentElement.scrollHeight + 0;
	obj.topLimit = 126;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";
	obj.style.left = obj.left + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 235;
		}
	}
	obj.move = setInterval(function() {
		pos = obj.getTop() + obj.getHeight() / 3 - 110;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 5;
		obj.style.top = obj.top + "px";
	}, 40)
}

/*
°ü½É°í°´µî·Ï
*/

function fGoRegist(argPROJECT_ID){
		$.post(
				"/sales/pop_favorite_confirm.asp",
				{ 'hPROJECT_ID': argPROJECT_ID, 'hURL' : document.URL},
				function (data) {
					if (data=="01") // ºñÈ¸¿øµî·Ï¿äÃ».
					{
						layer("/sales/pop_favorite.asp?hPROJECT_ID="+argPROJECT_ID+"&hURL="+document.URL, 498, 505);
						return ;
					}
					else if (data=="02")
					{
						alert("ÀÌ¹Ì ÇØ´ç´ÜÁöÀÇ °ü½É°í°´À¸·Î µî·ÏÇÏ¼Ì½À´Ï´Ù.");
						return;
					}
					else if (data=="09")
					{
						alert("ÀúÀåÁß ¿¡·¯°¡ ¹ß»ýÇß½À´Ï´Ù.´Ù½Ã ½ÃµµÇØ ÁÖ¼¼¿ä.");
						return;
					}
					else if (data=="0")
					{
						alert("ÇÊ¼ö°ª ´©¶ôÀÔ´Ï´Ù.");
						return;
					}
					else if (data=="1")
					{
						alert("°ü½É´ÜÁö·Î µî·ÏµÇ¼Ì½À´Ï´Ù.");
						return;
					}
					//$('#HotSales').html(data);
				}
		); //end $.get()
}

// Áßµµ±ÝÁ¶È¸.
function currencyFormat( fld, e ) {
	var milSep = ',' ;
	var decSep = '.' ;
	var strCheck = '0123456789.';
	var aux  = '' ;
	var aux2 = '' ;
	var arr ;
	var len ;
	var i, j;
	var vInteger = '' ;
	var vFraction = '' ;

     
	if (e.keyCode==48 & fld.value=="0") {
		return false;
	}
	
	if (fld.select() == false) {
		fld.value = "";
		aux = fld.value + Key;
	}
	if (e.keyCode == 13) return true;  
	
	var key = String.fromCharCode(e.keyCode);
	if (strCheck.indexOf(key) == -1) return false;
	if ( key == '.' && fld.value.indexOf(key) != -1 )  return false;

	if (fld.value == "0" & e.keyCode != 48) {
		fld.value = "";
		aux = fld.value + key ;
	}
	
	aux = fld.value + key ;
	arr = aux.split(decSep);

	for( i=0; i<arr[0].length; i++) 
		if( arr[0].charAt(i) != milSep )
			vInteger +=  arr[0].charAt(i) ;
	
	if( arr.lenth > 1 ) vFraction = arr[1] ;
	
	len = vInteger.length;

	if( len < 4 ) {     
		fld.value = aux ;
	} else {
		for (j = 0, i = len - 1; i >= 0; i--) {
			if (j == 3) {
				aux2 += milSep;
				j = 0;
			}
			aux2 += vInteger.charAt(i);
			j++;
			fld.focus();
		}

		fld.value = '';
		len2 = aux2.length;
		
		for (i = len2 - 1; i >= 0; i--)
			fld.value += aux2.charAt(i);
	}

	return false ;
}

//-->


function go_top()
{
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
		step = 2;

		while ((x != 0) || (y != 0)) {
				scroll (x, y);
				step += (step * step / 300);
				x -= step;
				y -= step;
				if (x < 0) x = 0;
				if (y < 0) y = 0;
		}
		scroll (0, 0);
}


// °ü½É°í°´µî·Ï > ¼öÁýÇÏ´Â °³ÀÎÁ¤º¸ Ç×¸ñ ·¹ÀÌ¾î
function registerPrivate(param)
{
	if (param==1)
	{
		layer("/sales/private1.asp", 700, 600);
	}
	else if (param==2)
	{
		layer("/sales/private2.asp", 700, 600);
	}	
	else if (param==3)
	{
		layer("/sales/private3.asp", 700, 600);
	}	
	else if (param==4)
	{
		layer("/sales/private4.asp", 700, 600);
	}	
	else if (param==5)
	{
		layer("/sales/private5.asp", 700, 600);
	}	
	else if (param==6)
	{
		layer("/sales/private6.asp", 700, 600);
	}	
	else
	{
	}

	// layer("/sales/private"+param+".asp", 350, 300);
}

