<!----default---->

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_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 EmbedObject() {
// Object
	var objectTAG		= new String;
	//SWF
	var classIDSWF		= 'CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000';
	var codeBaseSWF		= 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab';

	//WMP
	var classIDWMP		= 'CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95';
	var codeBaseWMP		= 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab';

// Param
	var parameterTAG	= new String;

// Embed
	var embedTAG		= new String;

	// SWF
	var typeSWF			= 'application/x-shockwave-flash';
	var pluginsPageSWF	= 'http://www.macromedia.com/go/getflashplayer';

	// WMP
	var typeWMP			= 'application/x-mplayer2';
	var pluginsPageWMP	= 'http://www.microsoft.com/Windows/MediaPlayer/';	

    this.embedSWF		= embedSWF;
    this.embedWMP		= embedWMP;
	this.editObject		= editObject;
    this.editParam		= editParam;
    this.editEmbed		= editEmbed;
    this.displayHTML	= displayHTML;
	this.showembedTAG	= showembedTAG;

	// Flash ³Ö´Â ÇÔ¼ö
	function embedSWF(srcSWF, widthSWF, heightSWF, objectID, alignSWF, verSWF) {

		//Script init
		objectTAG += "<OBJECT ";
		embedTAG += "<EMBED ";

		//Class ID
		objectTAG += "classid='"+ classIDSWF +"' ";
	
		//CodeBase, Version
		(verSWF) ? codeBaseSWF += "#version="+ verSWF : codeBaseSWF += "#version=8,0,0,0"
		this.editObject('codebase',codeBaseSWF);


		// Align
		if (alignSWF)	{
			this.editObject('align',alignSWF);
		}

		// ID
		if (objectID)	{
			this.editObject('id',ObjectID);
			this.editEmbed('name',objectID);
		}
		
		//Parameter
		this.editParam('quality','high');
		this.editParam('movie',srcSWF,'Param');

		//Embed tag
		this.editEmbed('src',srcSWF);
		this.editEmbed('pluginspage',pluginsPageSWF);
		this.editEmbed('type',typeSWF);


		if (widthSWF)	{
			this.editObject('width',widthSWF);
			this.editEmbed('width',widthSWF);
		}

		if (heightSWF)	{
			this.editObject('height',heightSWF);
			this.editEmbed('height',heightSWF);
		}
	}

	// Media Player ³Ö´Â ÇÔ¼ö
	function embedWMP(srcWMP, widthWMP, heightWMP, objectID, alignWMP, verWMP) {

		//Script init
		objectTAG += "<OBJECT ";
		embedTAG += "<EMBED ";

		//Class ID
		objectTAG += "classid='"+ classIDWMP +"' ";
	
		//CodeBase, Version
		(verWMP) ? codeBaseWMP += "#version="+ verWMP : codeBaseWMP += "#version=5,1,52,701"
		this.editObject('codebase',codeBaseWMP);

		//Type
		this.editObject('type','application/x-oleobject');

		// ID
		if (objectID)	{
			this.editObject('id',ObjectID);
			this.editEmbed('name',objectID);
		}

		// Align
		if (alignWMP)	{
			this.editObject('align',alignWMP);
		}
		
		//Parameter
		this.editParam('FileName',srcWMP,'Param');

		//Embed tag
		this.editEmbed('src',srcWMP);
		this.editEmbed('pluginspage',pluginsPageWMP);
		this.editEmbed('type',typeWMP);


		if (widthWMP)	{
			this.editObject('width',widthWMP);
			this.editEmbed('width',widthWMP);
		}

		if (heightWMP)	{
			this.editObject('height',heightWMP);
			this.editEmbed('height',heightWMP);
		}
	}
	
	//Object Tag
	function editObject(name, value) {
		objectTAG += " " + name + "='" + value + "' ";
	}

	//Parameter Tag
	function editParam(name, value, target) {

		parameterTAG += "<PARAM NAME='"+name+"' VALUE='"+value+"'>\n";
		
		// editParamÇÔ¼ö¿¡¼­ Object ¹× Embed¿¡ ÇÑ²¨¹ø¿¡ Áý¾î³ÖÀ½. 
		if (!target) {
			editEmbed(name, value);
		}
	}
	//Embed Tag
	function editEmbed(name, value) {
		embedTAG += " " + name + "='" + value + "' ";
	}

	//HTML¿¡ »Ñ·ÁÁÖ´Â ÇÔ¼ö
	function displayHTML() {
		objectTAG	+= ">\n";
		embedTAG	+= "></EMBED>\n";
		document.write(objectTAG);
		document.write(parameterTAG);
		document.write(embedTAG);
		document.write("</OBJECT>");
//		alert(objectTAG + parameterTAG + embedTAG);
	}

	function showembedTAG() {
		alert(objectTAG + parameterTAG + embedTAG);
	}
}



// ½½¶óÀÌµù ·¹ÀÌ¾î

var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements()
{
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

		 if ( bExplorer4plus ) {
                //yButtonFrom = parseInt (divLinkButton.style.top, 10);
                //yButtonTo   = document.body.scrollTop + document.body.clientHeight - 55;
                yMenuFrom   = parseInt (m_top.style.top, 10);
                yMenuTo     = document.body.scrollTop +288;
        }

        timeoutNextCheck = 100;

        if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }


        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

         if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;

               if ( bExplorer4plus )
                        m_top.style.top = parseInt (m_top.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}
function movingtop()
{
	    // we're not gonna be loaded in frames
        //if ( top.frames.length )
        //        top.location.href = self.location.href;

        // setting initial UI elements positions
        if ( bExplorer4plus ) {
                m_top.style.top = document.body.scrollTop +288;
                m_top.style.visibility = "visible";
                //divLinkButton.style.top = document.body.scrollTop + document.body.clientHeight - 55;
                //divLinkButton.style.visibility = "visible";
        }

        // initializing UI update timer
        CheckUIElements();
        //if ( bExplorer4plus )
        //        setTimeout ( "FlashTitleStepIt(255)", 10 );
        return true;
}