

//À¥Áø ¹Ù·Î°¡±â
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){
		var win = window.open('/viewpict.asp?hIMG_NAME=' + argURL + '&hSUBJECT=' + argSUBJECT, 'viewpict', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=50,top=50,width=100,height=100');
		win.focus();
	}


function fComm_GoImg_TEST(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 + 10 < sORG_WIDTH + 110) {
			sWIDTH = window.screen.width - 100
			sIS_SCROLL = "yes";
		}else{
			sWIDTH = sORG_WIDTH
		}
		
		alert(sIS_SCROLL);
		alert(window.screen.width + 10);
		alert(sORG_WIDTH);
		alert(sWIDTH);

		if (window.screen.height + 10 < sORG_HEIGHT + 120) {
			sHEIGHT = window.screen.height - 150
			sIS_SCROLL = "yes";
		}else{
			sHEIGHT = sORG_HEIGHT
		}

		alert(sIS_SCROLL);
		alert(window.screen.height);
		alert(sORG_HEIGHT);
		alert(sHEIGHT);

		var win = window.open('/pop_test.asp?hIMG_URL=' + argURL + '&hSUBJECT=' + argSUBJECT, 'viewpict', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + sIS_SCROLL + ',resizable=yes,left=50,top=50,width=' + sWIDTH + ',height=' + sHEIGHT);
		win.focus();
	}


 function fComm_resizeHeight(fr) {
 // fr = typeof fr == 'string' ? document.getElementById(fr) : fr;
 // fr.setExpression('height',fr.document.body.scrollHeight);
  
 //document.detail.setExpression('height',detail.document.body.scrollHeight);
  
 // document.all("detail").style.height = document.frames("detail").document.body.scrollHeight + 40;
  
 // alert(detail.document.body.innerHTML );

        var Frame_Body  = document.frames(fr).document.body;
        var Frame_name  = document.all(fr);
        //Frame_name.style.width  = Frame_Body.scrollWidth + (Frame_Body.offsetWidth-Frame_Body.clientWidth);
        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 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 fGoLeftWebZine()
{
	var win = window.open('http://www.thesharp.co.kr/webzine/200803/');
	win.focus();
}

// ÁÂÃø ¹Ý¿Ã¸²Æ÷ÀÎÆ® È£ÃâÇÔ¼ö
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();
} 