var htmlSTR = ""
+"<table width='280' height='17' border='0' cellpadding='0' cellspacing='0' oncontextmenu='return false;'>"
+"  <tr>"
+"    <td width='234'></td>"
+"    <td width='40' height='17' valign='bottom'><img src='http://img.yahoo.co.kr/webcall/logo1.gif' width='40' height='17'></td>"
+"    <td width='6'></td>"
+"  </tr>"
+"</table>"
+"<table width='280' border='0' cellspacing='0' cellpadding='0'>"
+"  <tr>"
+"    <td width='6'><table width='6' height='88' border='0' cellpadding='0' cellspacing='0'>"
+"        <tr>"
+"          <td><img src='http://img.yahoo.co.kr/webcall/corner1.gif' width='6' height='6'></td>"
+"        </tr>" 
+"        <tr>"
+"          <td height='76' background='http://img.yahoo.co.kr/webcall/left_bg.gif'></td>"
+"        </tr>"
+"        <tr>"
+"          <td><img src='http://img.yahoo.co.kr/webcall/corner3.gif' width='6' height='6'></td>"
+"        </tr>"
+"      </table></td>"
+"    <td>"
+" <table width='268' height='45' border='0' cellpadding='0' cellspacing='0' background='http://img.yahoo.co.kr/webcall/top.gif'>"
+"        <tr>"
+"          <td width='10'></td>"
+"    <td align='' background='http://img.yahoo.co.kr/webcall/bar_bg.gif'><font color=000000 style='font-size: 9pt; text-decoration:none; line-height:1.2;'>¿¬°á¹ÞÀ¸½Ç ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã¸é<br> ¾÷Ã¼¿Í ¹Ù·Î ÅëÈ­°¡ °¡´ÉÇÕ´Ï´Ù. <b>(¹«·á)</b></font></td>"
//+"          <td width='40' align=center><img src='http://img.yahoo.co.kr/webcall/logo2.gif' width='40' height='45' align='top'></td>"
+"          <td width='40' align=center><a href='javascript:closeAction()' onfocus='this.blur()'><img src='http://img.yahoo.co.kr/webcall/logo2.gif' width='40' height='45' align='top' border=0></a></td>"
+"        </tr>"
+"      </table>"
+"      <table width='268' height='43' border='0' cellpadding='0' cellspacing='0' background='http://img.yahoo.co.kr/webcall/bt.gif'>"
+"        <tr>"
+"          <td><table width='268' border='0' cellspacing='0' cellpadding='0'>"
+"              <tr>"
+" <form name=webcallf onsubmit='return webcall()'>"
+"        <input type=hidden name=service value=''>"
+"        <input type=hidden name=ant value=''>"
+"                <td valign='middle'><img src='http://img.yahoo.co.kr/webcall/phone.gif' width='22' height='18' align='absbottom'><font color=1111AA style='font-size: 9pt; text-decoration:none;'><b>¹ÞÀ¸½Ç ¹øÈ£</b></font></td>"
+"                <td><input type=text name=dst size=18 maxlength=15 style='background-color:#FFFFFF; color:#000000; border:1px solid #3C85DA; font-family:µ¸¿ò; FONT-SIZE: 9pt; padding: 3 0 0 3; letter-spacing:-0.04em;'  value=''   onkeydown='return ch();' onClick='return ch()' ></td>"
+"                <td><input type='image' style='width: 50px;height: 20px; border:0; cursor:hand' src='http://img.yahoo.co.kr/webcall/btn_ok.gif' width='50' height='20'></td>"
+"              </tr>"
+"     <tr>"
+"                <td style=padding-left:10></td>"
+"					<td align=right style='padding-right:22px'><font color=#000000 style=';FONT-SIZE: 9pt; text-decoration:none;'> </font></td>"				  
+"                <td style='padding: 3 0 0 0'><a href='javascript:infoPopup()'><font color=#000000 style='font-family:µ¸¿ò;font-size: 8pt; text-decoration:none; line-height:1.2;'> *»ç¿ë¾È³»</font></a></td>"
+"   </form>"
+"              </tr>"
+"            </table></td>"
+"        </tr>"
+"      </table></td>"
+"    <td width='6'><table width='6' height='88' border='0' cellpadding='0' cellspacing='0'>"
+"        <tr> "
+"          <td><img src='http://img.yahoo.co.kr/webcall/corner2.gif' width='6' height='6'></td>"
+"        </tr>"
+"        <tr> "
+"          <td height='76' background='http://img.yahoo.co.kr/webcall/right_bg.gif'></td>"
+"        </tr>"
+"        <tr> "
+"          <td><img src='http://img.yahoo.co.kr/webcall/corner4.gif' width='6' height='6'></td>"
+"        </tr>"
+"      </table></td>"
+"  </tr>"
+"</table>"
document.write("<span id=webcall_div style='cursor:default; VISIBILITY: hidden; Z-INDEX: 2; LEFT: -300px; TOP: 100px; BOTTOM:100px; RIGHT:200px; WIDTH:280px; HEIGHT:105px; POSITION: absolute;'>");
document.write(htmlSTR + "</span>");

var method_type = document.attachEvent;

var lW;		// layer width
var lH;		// layer Height
var lL;		// layer left
var lT;		// layer top
var sL;		// body scroll left
var sT;		// body scroll top
var mX;		// mouse x position
var mY;		// mouse y position
var webcall_div;	// webcall div reference
var body;	// body reference
var c=false;
var action_hidden ="1";

function ch () {
if ( c ) return true;
document.webcallf.dst.value="";
c=true;
return true;
}

function clear_text(){

	document.webcallf.dst.value='';
}


// body function
function FindBodyScrollCoordinates (  )
{
	if ( document.documentElement && document.documentElement.scrollTop) {
		sT = document.documentElement.scrollTop;
		sL = document.documentElement.scrollLeft;
	} else {
		sT = document.body.scrollTop;
		sL = document.body.scrollLeft;
	}
}

// layer function
function FindLayerCoordinates(layer)
{
	lL = parseInt(layer.style.left);
	lT = parseInt(layer.style.top);
	lW = parseInt(layer.style.width);
	lH = parseInt(layer.style.height);
}
function MoveLayerTo ( layer, posx, posy )
{ 
	layer.style.left = posx;
	layer.style.top = posy;
}
function MoveLayerBy ( layer, incx, incy )
{ 
	layer.style.left = parseInt ( layer.style.left ) + incx;
	layer.style.top = parseInt ( layer.style.top ) + incy;
}
// mouse
function FindMouseCoordinates ( e )
{
	FindBodyScrollCoordinates (  );
	mX = e.clientX + sL;
	mY = e.clientY + sT;
}

function MouseMoveHandler ( e )
{
	beforeMX = mX;
	beforeMY = mY;
	FindMouseCoordinates ( e );
	MoveLayerBy ( webcall_div, mX - beforeMX, mY - beforeMY );
	return false;
}
function MouseUpHandler ( e )
{
	if ( method_type ) {
		document.detachEvent ( 'onmousemove', MouseMoveHandler );
		document.detachEvent ( 'onmouseup', MouseUpHandler );
	}
	else {
		document.removeEventListener ( 'mousemove', MouseMoveHandler, false);
		document.removeEventListener ( 'mouseup', MouseUpHandler, false );
	}
	return false;
}
// when mouse is down
function MouseDownHandler( e )
{
	
	action_hidden = "1";
	FindMouseCoordinates ( e ) ;
	FindLayerCoordinates ( webcall_div );
	if ( webcall_div.style.visibility == "visible" ) {
		if ( ! ( ( lL < mX && mX < lL + lW ) && ( lT < mY && mY < lT + lH ) ) ) { 
			if ( method_type ){
				document.detachEvent( 'onmousedown', MouseDownHandler );
				webcall_div.style.visibility = "visible";
			}
			else
				document.removeEventListener ( 'mousedown', MouseDownHandler, false );
			webcall_div.style.visibility = "hidden";
			hidePopup(  );
		}
	}
	else
		return	false ;
}
function movePopup( e )
{
	FindLayerCoordinates ( webcall_div );
	FindMouseCoordinates ( e );
	if ( method_type ) {
		document.attachEvent ( 'onmousemove', MouseMoveHandler );
		document.attachEvent ( 'onmouseup', MouseUpHandler );
	}
	else {
		document.addEventListener ( 'mousemove', MouseMoveHandler, false );
		document.addEventListener ( 'mouseup', MouseUpHandler, false );
	}
    return false;
}

function showPopup (e,url)
{

	
	webcall_div = document.getElementById ( "webcall_div" );
	body = document.getElementsByTagName ( "body" ).item ( 0 );

	//document.webcallf.dst.value='¿¹) 0XX-XXX-XXXX';
    if (!c){ 
     document.webcallf.dst.value='¿¹) 0XX-XXX-XXXX';
    }

	FindMouseCoordinates ( e );
	webcall_div.style.visibility = "visible";
	//	MoveLayerTo ( webcall_div, mX + 20, mY - 10 );
	MoveLayerTo ( webcall_div, mX + 20 , mY - 10 );

	document.webcallf.service.value = url;

	document.getElementsByName("webcallf")[0].dst.focus();
	//document.getElementsByName("webcallf")[0].dst.value = '';
//	document.webcallf.url=url;

	if ( method_type ) {
		document.attachEvent ( 'onmousedown', MouseDownHandler );
		webcall_div.attachEvent ( 'onmousedown', movePopup );
	} else {
		document.addEventListener ( 'mousedown', MouseDownHandler, false );
		webcall_div.addEventListener ( 'mousedown', movePopup, false );
	}
	return false;
}



function hideAction(){
	action_hidden = "2";
	return false;
}

function hidePopup ( action )
{   

	if(action == "1" && action_hidden == "1"){
		webcall_div.style.visibility = "hidden";
		return false;
	}else if(action_hidden == 2){
		webcall_div.style.visibility = "visible";
		return false;
	}
}

function closeAction(){
	webcall_div.style.visibility = "hidden";
	//return false;
}

function webcall()

{
  var service = document.webcallf.service.value;
  var ant = document.webcallf.ant.value;
  var dst = number(document.webcallf.dst.value);
  var Surl = document.webcallf.service.value;


  if(dst==""){
	 alert("ÀÔ·ÂµÈ °ª¿¡ ¼ýÀÚ°¡ ¾ø½À´Ï´Ù.");
	 document.webcallf.dst.value="";
	 document.webcallf.dst.focus();
	 return false;
	 
  }
	
	var url = Surl + "&dst=" +dst;

	var name = "webcall" + Math.random() * 10000000000000000000;

	webcallWindow=window.open(url,name,"resizable=no,scrollbars=no,menubar=no,status=no,width=400,height=240,left=50,top=50");
	hidePopup();
	webcallWindow.focus();
	return false;

}


function enter() { 
	if( event.keyCode == 13){ 
		webcall();
		hidePopup();
	}
	
}

function number(name_v){
					
	var comp="0123456789"; 
	var tmp_str="";
	var str=name_v; 
	var len = str.length; 
	for(i=0;i<len;i++) { 
			if(comp.indexOf(str.substring(i,i+1))>-1) { 	
				tmp_str=tmp_str+str.substring(i,i+1);
			}
	}
	return tmp_str;

}

function infoPopup() { //v2.0
 
  //'http://webcall.yahoo.co.kr/_tpl/popup/guide/guide.html','a','width=542,height=571'
  window.open('http://webcall.yahoo.co.kr/_tpl/popup/guide/guide.html','winName','width=542,height=571');
}


