//·Ñ¿À¹ö ÀÌ¹ÌÁö
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}




//·¹ÀÌ¾î º¸ÀÌ±â/°¨Ãß±â
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




//»õÃ¢¿­±â
function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
 toolbar_str = toolbar ? 'yes' : 'no';
 menubar_str = menubar ? 'yes' : 'no';
 statusbar_str = statusbar ? 'yes' : 'no';
 scrollbar_str = scrollbar ? 'yes' : 'no';
 resizable_str = resizable ? 'yes' : 'no';
 window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}




//¸¶¿ì½º¿À¹ö ½ºÅ©·Ñ¸ØÃã
function Marq(kind)
{
	switch(kind) {
	case 1:
	mq_notice.stop();
	break;
	}
	switch(kind) {
	case 2:
	mq_notice.start();
	break;
	}
}





//ÆäÀÌÁö ·Îµù½Ã°£
Start = new Date()
function NoteTime()
{
    Stop = new Date()
	Diff = Stop.getTime() - Start.getTime();
	Diff = Diff / 1000
		window.status=("ÀÌ ÆäÀÌÁö´Â: " + Diff + " ÃÊ ¸¸¿¡ ¿­·ÈÀ¾´Ï´Ù");
		//    alert("ÀÌ ÆäÀÌÁö¸¦ ·ÎµùÇÏ´Âµ¥ " +Diff + " ÃÊ°¡ °É·È½À´Ï´Ù"); //µÎ°¡ÁöÁß ÇÑ°¡Áö´Â Áö¿ì¼Åµµ µË´Ï´Ù
}

//¸µÅ©Á¡¼±
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;


//PNG¾ËÆÄ IEÀû¿ë
function setPng24(obj) {
    obj.width=obj.height=1;
    obj.className=obj.className.replace(/\bpng24\b/i,'');
	//alert(obj.src);
    obj.style.filter =
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
    //obj.src='';
    return '';
}



function FlashXmlbody(Ftrans,wid,hei) {
 mainbody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+ wid +"' height='"+ hei +"'>";
 mainbody += "<param name='movie' value='"+ Ftrans +"'>";
 mainbody += "<param name='quality' value='high'>";
 mainbody += "<param name='menu' value='false'>";
 mainbody += "<param name='scale' value='noscale'>";
 mainbody += "<param name='wmode' value='transparent'>";
 mainbody += "<param name='salign' value='lt' />";
 mainbody += "<embed src='"+ Ftrans +"' quality='high' align='middle' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ wid +"' height='"+ hei +"'></embed>"
 mainbody += "</object>";

 document.write(mainbody);
 return;
}





function messageReloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=messageReloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
messageReloadPage(true);

function messageFindObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=messageFindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}




function messageShowHideLayer() { // MM_showHideLayersv6.0 ÇÔ¼ö ÀÌ¸§¸¸ º¯°æ (Ãæµ¹¹æÁö)
	var i,p,v,obj,args=messageShowHideLayer.arguments;
	for (i=0; i<(args.length-2); i+=3)
	{
		if ((obj=messageFindObj(args[i]))!=null) {
			v=args[i+2];
			if (obj.style) {
				obj=obj.style;
				v=(v=='show')?'visible':(v=='hide')?'hidden':v;
			}

			obj.visibility=v;
			if ( v == 'hide' || v == 'hidden' )
			{
				obj.left	= -555;
				obj.top		= -555;
			}
			else
			{
				happyMessageLayerCheck	= true;
				obj.left	= event.x + ietruebody().scrollLeft - 0 ;
				obj.top		= event.y + ietruebody().scrollTop - 0;
			}
		}
	}
}


function messageShowUser( userid )
{
	document.getElementById('dhtmltooltip').style.border	= '';
	document.getElementById('dhtmltooltip').style.background	= '';
	document.getElementById('dhtmltooltip').style.width = '130';
	document.getElementById('dhtmltooltip').innerHTML = "<table cellpadding='2' cellspacing='0' onClick=\"messageShowHideLayer('dhtmltooltip','','hide')\"><tr><td width='110' bgcolor='#D9D9D9'><table cellpadding='2' cellspacing='1' width='100%' bgcolor='#CACACA'><tr><td bgcolor='white'><table cellpadding='2' cellspacing='0' width='100%'><tr><td height='25'><a href='#1' onClick=\"window.open('happy_message.php?mode=send&receiveid="+userid+"','happy_message_send','width=700,height=400,toolbar=no,scrollbars=no')\"><img align='absmiddle' src='img/message/icon_messicon.gif' width='15' height='12' border='0'><img src='img/binimg.gif' width='5' height='1' border='0'>ÂÊÁöº¸³»±â</a></td></tr><tr><td height='25'><a href='dealer_view.php?id="+userid+"'><img align='absmiddle' src='img/message/icon_messregi.gif' width='16' height='16' border='0'><img src='img/binimg.gif' width='4' height='1' border='0'>µî·Ï¸Å¹°º¸±â</a></td></tr></table></td></tr></table></td></tr></table>";
	messageShowHideLayer('dhtmltooltip','','show');


	//document.onClick	= messageShowHideLayer('dhtmltooltip','','hide');
}

var happyMessageLayerCheck = false;
document.onclick = function()
{
	if (!happyMessageLayerCheck)
		messageShowHideLayer('dhtmltooltip','','hide');
	else
		happyMessageLayerCheck = false;
}


//·¹ÀÌ¾îÅøÆÁ °ü·Ã [start]  /////////////////////////////////////////////
var offsetxpoint=60 //Customize x offset of tooltip
var offsetypoint=130 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}


function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}
document.onmousemove=positiontip
//·¹ÀÌ¾îÅøÆÁ °ü·Ã [end]  /////////////////////////////////////////////
