//---------------------------------------------------------------------------------- ·¹ÀÌ¾îÀ§Ä¡
//function setX(){ 
//      document.getElementById('login_topbtn').style.top=57;
//      document.getElementById('login_topbtn').style.left=document.body.clientWidth/2+(-475);
//}
//---------------------------------------------------------------------------------- ÆË¾÷
function notice_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 MM_openBrWindow(theURL,winName,features)
{
  window.open(theURL,winName,features);
}

//---------------------------------------------------------------------------------- ÀÌ¹ÌÁö Å×µÎ¸® »èÁ¦
var myAnchors=document.all.tags("A"); 
function allblur() {
	for (i=0;i<myAnchors.length;i++) { 
		myAnchors[i].onfocus=new Function("blur()");
	} 
}
allblur();

function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 

//---------------------------------------------------------------------------------- ÀÍ½ºÇÃ·Î·¯ ÀüÃ¼È­¸éÀüÈ¯
function relocate() {
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
}

//---------------------------------------------------------------------------------- basic script
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
  var obj=MM_findObj(objStr);
  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');
}

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_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_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_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_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 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_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//==============================================================================================================//
//==============================================================================================================//

//---------------------------------------------------------------------------------- Active
function setEmbed(){ 
	
  var obj = new String; 
  var parameter = new String; 
  var embed = new String; 
  var html = new String; 
  var allParameter = new String; 
  var clsid = new String; 
  var codebase = new String; 
  var sameDomain = new String; 
  var embedType = new String; 
  var pluginspace = new String; 
  var src = new String; 
  var transparent = new String; 
  var bgcolor = new String; 
  var width = new String; 
  var height = new String; 
  var height2 = new String; 
  var Id = new String; 
  var align = new String; 

  this.init = function( getType, s, f_trans, f_color, f_width, f_height, f_height2, f_Id, f_align, oId ) { 
      if ( getType == "flash" ) 
      { 
      		clsid="d27cdb6e-ae6d-11cf-96b8-444553540000";
      		codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0";
			sameDomain="sameDomain";
      		embedType="application/x-shockwave-flash";
		pluginspage="http://www.macromedia.com/go/getflashplayer";
      } 
      else if ( getType == "movie" ) 
      { 
      		clsid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"	;
      		codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" ;
      		embedType="application/x-mplayer2";
		pluginspage="http://www.microsoft.com/windows/mediaplayer/download/default.asp"
      } 
      /* type Ãß°¡ 
      else if ( ) 
      { 
      } 
      */
            
      parameter += "<param name='allowScriptAccess' value='sameDomain'>\n"; 
      parameter += "<param name='SeamlessTabbing' value='false'>\n"; 
      parameter += "<param name='movie' value='"+ s +"'>\n"; 
      parameter += "<param name='wmode' value='"+ f_trans +"'>\n"; 
      parameter += "<param name='align' value='center'>\n"; 
      parameter += "<param name='scale' value='noscale'>\n"; 
      parameter += "<param name='quality' value='high'>\n"; 
      parameter += "<param name='menu' value='false'>\n"; 
	  parameter += "<param name='SeamlessTabbing' value='false'>\n";
            
      src = s;
	  transparent = f_trans;
	  bgcolor = f_color;
      width = f_width; 
      height = f_height; 
      height2 = f_height2; 
      Id = f_Id;
	  align = f_align;
      objId = oId;
  } 
  
  this.parameter = function( parm , value ) {      
      parameter += "<param name='"+parm +"' value='"+ value + "'>\n";        
      allParameter += " "+parm + "='"+ value+"'"; 
  }  
  

  this.show = function() { 
      if ( clsid ) 
      { 
        obj = "<object id=" + objId + " classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"' value='" + objId + "' id='"+ Id +"' align='"+ align +"'>\n"; 
      } 
      	embed = "<embed id='" + objId + "' src='" + src + "' wmode='"+ transparent +"' bgcolor='"+ bgcolor +"' width='"+ width + "' height='"+ height2 +"' name='"+ Id +"' align='"+ align +"' allowScriptAccess='"+ sameDomain + "' type='"+ embedType + "' pluginspage='"+ pluginspage + "' "+ allParameter +"'> </embed>"; 

      if ( obj ) 
      { 
        embed += "</object>"; 
      } 
      html = obj + parameter + embed; 
      document.write( html );  

	if ( objId)
      	{	
      			var Objv = document.getElementById(objId);
      			if (Objv.value==objId) {
      				eval("document." + objId + ".focus();");
      			}
    	}
  } 
}

//function funcPlay(playId){
//	if( document.getElementById(playId).PlayState != 2 ){
//		document.getElementById(playId).Play();
//	}
//}

//function funcPause(playId){
//	if( document.getElementById(playId).PlayState == 2 ){
//		document.getElementById(playId).Pause();
//	}
//}

//function funcStop(playId){
//	document.getElementById(playId).Stop();
//}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function flashfile(location2,f_width2,f_height3){
	document.write("<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="+f_width2+" height="+f_height3+">");
	document.write("<param name=movie value="+location2+" />");
	document.write("<param name=quality value=high />");
	document.write("<param name=SCALE value=noborder />");
	document.write("<param name=wmode value=transparent />");
	document.write("<param name=menu value=false />");
	document.write("<embed src="+location2+" quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width="+f_width2+" height="+f_height3+"></embed></object>");
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function game01main(location2,f_width2,f_height3){
	document.write("<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="+f_width2+" height="+f_height3+">");
	document.write("<param name=movie value="+location2+" />");
	document.write("<param name=quality value=high />");
	document.write("<param name=SCALE value=noborder />");
	document.write("<param name=wmode value=transparent />");
	document.write("<param name=menu value=false />");
	document.write("<embed src="+location2+" quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width="+f_width2+" height="+f_height3+"></embed></object>");
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function swf_obj02(src,w,h,swfid){
	swf_html = '';
	swf_html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'" id="'+swfid+'" align="middle">';
	swf_html += '<param name="allowScriptAccess" value="always">';
	swf_html += '<param name="movie" value="'+src+'">';
	swf_html += '<param name="quality" value="high">';
	swf_html += '<param name="scale" value="noborder">'
	swf_html += '<param name="wmode" value="transparent">';
	swf_html += '<param name="bgcolor" value="#FFFFFF">';
	swf_html += '<param name="menu" value="false">';
	swf_html += '<embed src="'+src+'" quality="high" bgcolor="#FFFFFF" width="'+w+'" height="'+h+'" name="'+swfid+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
	swf_html += '</object>';
	document.write(swf_html);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// swf movie object Ã£±â
function swfMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
}
// flashÇÔ¼ö È£Ãâ
function showBasket(target, cnt, action) {
	//alert("showBasket : " + target + ", " + cnt + ", " + action);
	swfMovie("GNB_BOTTOM").showBasket(target, cnt, action);
}

// flashÇÔ¼ö È£Ãâ
function basketChange(src, target, cnt) {
	//alert("basketChange : " + src + ", " + target + ", " + cnt);
	swfMovie("GNB_BOTTOM").basketChange(src, target, cnt);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function resizeWin(maxX,maxY,speed,delay,win){
	this.obj = "resizeWin" + (resizeWin.count++);
	eval(this.obj + "=this");
	if (!win)     this.win = self;    else this.win = eval(win);
	if (!maxX)    this.maxX = 1000;    else this.maxX = maxX;
	if (!maxY)    this.maxY = 750;    else this.maxY = maxY;
	if (!speed)   this.speed = 1;   else this.speed = 1/speed;
	if (!delay)   this.delay = 0;    else this.delay = delay;
	this.doResize = (document.all || document.getElementById);
	this.stayCentered = false;
	
	this.initWin = 	function(){
		if (this.doResize){
			this.resizeMe();
			}
		else {
			this.win.resizeTo(this.maxX + 10, this.maxY - 20);
			}
		}

	this.resizeMe = function(){
		this.win.focus();
		this.updateMe();
		}
	
	this.resizeTo = function(x,y){
		this.maxX = x;
		this.maxY = y;
		this.resizeMe();
		}
		
	this.stayCentered = function(){
		this.stayCentered = true;
		}

	this.updateMe = function(){
		this.resizing = true;
		var x = Math.ceil((this.maxX - this.getX()) * this.speed);
		var y = Math.ceil((this.maxY - this.getY()) * this.speed);
		if (x == 0 && this.getX() != this.maxX) {
			if (this.getX() > this.maxX) x = -1;
			else  x = 1;
			}
		if (y == 0 && this.getY() != this.maxY){
			if (this.getY() > this.maxY) y = -1;
			else y = 1;
			}
		if (x == 0 && y == 0) {
			this.resizing = false;
    		}
		else {
			this.win.top.resizeBy(parseInt(x),parseInt(y));
			if (this.stayCentered == true) this.win.moveTo((screen.width - this.getX()) / 2,(screen.height - this.getY()) / 2);
			setTimeout(this.obj + '.updateMe()',this.delay)
			}
		}
		
	this.write =  function(text){
		if (document.all && this.win.document.all["coords"]) this.win.document.all["coords"].innerHTML = text;
		else if (document.getElementById && this.win.document.getElementById("coords")) this.win.document.getElementById("coords").innerHTML = text;
		}
		
	this.getX =  function(){
		if (document.all) return (this.win.top.document.body.clientWidth + 10)
		else if (document.getElementById)
			return this.win.top.outerWidth;
		else return this.win.top.outerWidth - 12;
	}
	
	this.getY = function(){
		if (document.all) return (this.win.top.document.body.clientHeight + 29)
		else if (document.getElementById)
			return this.win.top.outerHeight;
		else return this.win.top.outerHeight - 31; 
	}
	
	this.onResize =  function(){
		if (this.doResize){
			if (!this.resizing) this.resizeMe();
			}
		}

	return this;
}
resizeWin.count = 0;

//¹Ì´Ï¾Ù¹ü¿¡¼­ ¼¿·¢Æ®¹Ú½º·Î ÀÌ¿ô¹Ì´ÏÈ¨ÇÇ·Î ÀÌµ¿ÇÏ´Â
function Move_Mini(M_ID)
{
	if(M_ID !="")
	{
		var url="/html/07_minihome/index.html?mini_id="+M_ID;
		self.location=url;
	}
}

//¹Ì´Ï¾Ù¹ü¿¡¼­ ¾ÆÀÌÇÁ·¹ÀÓ¾È¿¡¼­ ´Ù¸¥¹Ì´ÏÈ¨ÇÇ·Î ÀÌµ¿ÇÏ´Â ÇÔ¼ö
function Move_Mini_Parent(M_ID)
{
	if(M_ID !="")
	{
		var url="/html/07_minihome/index.html?mini_id="+M_ID;
		parent.location=url;
	}
}

//¹Ì´Ï¾Ù¹üÀ» ÆË¾÷À¸·Î ¶ç¿ì´Â ÇÔ¼ö
function Open_Mini(M_ID)
{
	if(M_ID !="")
	{
		var url="/html/07_minihome/index.html?mini_id="+M_ID;
		window.open(url,'MINi_OPEN','width=932,height=565');
	}
}

// ------------------------------------------------------------------------------------------------------------------ //
// ------------------------------------------------------------------------------------------------------------------ //

function FL_RunContent() {
    var ret = getArguments( arguments, '.swf', "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash" );
    GenerateObj( ret.objAttrs, ret.params, ret.embedAttrs);
}

function AddExtension(src, ext) {
    if (src.indexOf('?') != -1)
        return  src.replace(/\?/, ext+'?');
    else 
        return src + ext;
}

function GenerateObj(objAttrs, params, embedAttrs, writeType) {
    //Object
    var str = '<object ';
    for (var i in objAttrs)
        str += i + '="' + objAttrs[i] + '" ';   
    str += ' VIEWASTEXT>';
    //Params
    for (var i in params)
        str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    //Embed
    str += '<embed ';       
    for (var i in embedAttrs)
        str += i + '="' + embedAttrs[i] + '" ';
    str += ' ></embed></object>';
    
    // Generate
    if (!writeType) {
        document.write(str);
    } else {
        return str;     
    }
}

function getArguments(args, ext, classid, mimeType) {
    var ret = new Object();
    ret.objAttrs = new Object();
    ret.params = new Object();
    ret.embedAttrs = new Object();
    
    for ( var i=0; i<args.length; i=i+2 ) {
        var currArg = args[i].toLowerCase();
        switch (currArg) {
            case "classid":
                break;
            
            case "pluginspage":
                ret.embedAttrs[args[i]] = args[i+1];
                break;
            
            case "src":
            case "movie":   
                args[i+1] = AddExtension(args[i+1], ext);
                ret.embedAttrs["src"] = args[i+1];
                ret.params["movie"] = args[i+1];
                break;
            
            case "onafterupdate":
            case "onbeforeupdate":
            case "onblur":
            case "oncellchange":
            case "onclick":
            case "ondblClick":
            case "ondrag":
            case "ondragend":
            case "ondragenter":
            case "ondragleave":
            case "ondragover":
            case "ondrop":
            case "onfinish":
            case "onfocus":
            case "onhelp":
            case "onmousedown":
            case "onmouseup":
            case "onmouseover":
            case "onmousemove":
            case "onmouseout":
            case "onkeypress":
            case "onkeydown":
            case "onkeyup":
            case "onload":
            case "onlosecapture":
            case "onpropertychange":
            case "onreadystatechange":
            case "onrowsdelete":
            case "onrowenter":
            case "onrowexit":
            case "onrowsinserted":
            case "onstart":
            case "onscroll":
            case "onbeforeeditfocus":
            case "onactivate":
            case "onbeforedeactivate":
            case "ondeactivate":
            case "type":
            case "codebase":
                ret.objAttrs[args[i]] = args[i+1];
                break;
                
            case "width":
            case "height":
            case "align":
            case "vspace": 
            case "hspace":
            case "class":
            case "title":
            case "accesskey":
            case "name":
            case "id":
            case "tabindex":
                ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
                break;
                
            default:
                ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
        }
    }
    ret.objAttrs["classid"] = classid;
    if (mimeType) ret.embedAttrs["type"] = mimeType;
    
    return ret;
}

function showembed(we,hi,f_name){ 
    var id = "flash"+Math.floor(Math.random()*100);
    var f_object = '<noscript><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+we+'" height="'+hi+'" id="'+id+'" align="middle">';
    f_object    += '<param name="allowScriptAccess" value="sameDomain" />';
    f_object    += '<param name="allowFullScreen" value="true" />';
    f_object    += '<param name="movie" value="'+f_name+'" />';
    f_object    += '<param name="menu" value="false" />';
	f_object    += '<param name="wmode" value="transparent" />';
    f_object    += '<param name="quality" value="best" />';
    f_object    += '<param name="salign" value="lt" />';
    f_object    += '<param name="bgcolor" value="#ffffff" />';
    f_object    += '<embed src="'+f_name+'" menu="true" wmode="transparent" quality="best" salign="lt" bgcolor="#ffffff" width="'+we+'" height="'+hi+'" name="'+id+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';//<param name="wmode" value="transparent" />, wmode="transparent" ºüÁü
    f_object    += '</object></noscript>';

    document.write(f_object);
    
    var f_rename = f_name.replace(".swf", "");

    FL_RunContent(
                    'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
                    'width', we,
                    'height', hi,
                    'src', f_rename,
                    'quality', 'best',
                    'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                    'align', 'middle',
                    'play', 'true',
                    'loop', 'true',
                    'scale', 'showall',
                    'devicefont', 'false',
                    'wmode', 'transparent',
                    'id', id,
                    'bgcolor', '#FFFFFF',
                    'name', id,
                    'menu', 'true',
                    'allowFullScreen', 'true',
                    'allowScriptAccess','sameDomain',
                    'movie', f_rename,
                    'salign', 'lt'
                    ); //end AC code
}

// ------------------------------------------------------------------------------------------------------------------ //
// ------------------------------------------------------------------------------------------------------------------ //

//---------------------------------------------------------------------------------- mouse no click
//function click() {
//if ((event.button==2) || (event.button==3)) {
//alert('¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°Àº »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
//}
//}
//document.onmousedown=click;

//if (navigator.appName == "Netscape") {
//document.captureEvents(Event.MOUSEDOWN)
//document.onmousedown = checkClick
//function checkClick(ev) {
//        if (ev.which != 1) {
//                alert('¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°Àº »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.')
//                return false
//        }
//}
//}

