var PlayerState = 
{ 
	None: "None",
	Stopped: "Stopped",
	Playing: "Playing",
	Paused: "Paused",
	Buffering: "Buffering",
	Opening: "Opening",
	Closed: "Closed",
	End_Element: "End_Element"
};

SilverlightControl = function()
{
    this.bWindowless = false;
    this.background = "#FFFFFFFF";
    this.playtime = 0;
    this.disableScrapButton = false;
    this.disableArticleInfoPanel = false;
    this.disableOtherMovieButton = false;

    this.disableMovieListPanel = false;
	this.disablePreviewPanel = false;

	this.directMovieFileAcess = false;
	
    this.mediaPlayerWidth = 600;
    this.mediaPlayerHeight = 448;
    this.ajaxMovieURL = "/NxFile/Download/MovieAmlDownloader.aspx";

	this.isShowStartLogo = false;
	this.showStartLogoUrl = "";
	this.ableCategory = "";
	var strHref = document.location.href.toLowerCase();
	var targetURL= "channel.nexon.com";

	if(strHref.indexOf(targetURL) != -1)
	{
		this.ableCategory = "5,10,11,22"; //full category "all"
		this.showStartLogoUrl = "http://vod.nexon.co.kr/CH_FUN/chFUN.wmv";
		//this.showStartLogoUrl = "http://channel.nexon.com/movie/logo.wmv";
	}
	
}

SilverlightControl.prototype = 
{
    createControl: function()
    {
		var _checkSilverlight = installSilverlight.check();
		var countMovie = "0";
		if(countMovie == "0")
		{
			switch (_checkSilverlight)
			{
				case "installed" :
					silverlightInstallLog("Installed");
					var scene = new NxPlayer.Page();
					
					// [strong mandatory] ¾øÀ¸¸é ÇÃ·¹ÀÌ¾î »ý¼º Â÷´Ü - ¿¡·¯
					// this.ID - ¿¡·¯
					// this.XAMLURL - ¿¡·¯

					// [weak mandatory] ¾øÀ¸¸é ÇÃ·¹ÀÌ¾î¿¡¼­ ¿À·ù ¸Þ½ÃÁö ÆË¾÷ - ¿¹¿Ü Ã³¸® (±â´É Á¤Áö)
					// this.movieURL - µ¿¿µ»ó Á¤º¸ ¾øÀ½ ¿¹¿Ü
					// this.fontURL - ÆùÆ® ¾øÀ½ ¿¹¿Ü

					// [optional] ¾øÀ¸¸é ¿©±â¼­, È¤Àº ÇÃ·¹ÀÌ¾î¿¡¼­ ¾Ë¾Æ¼­ Ã³¸® - Á¤»ó ÀÛµ¿
					// this.hostID - createControl ÀÇ ¹ÝÈ¯°ªÀ¸·Î ½Ç¹ö¶óÀÌÆ® ÄÁÆ®·Ñ HTML ¸®ÅÏ
					// this.bWindowless - ±âº»°ª:false
					// this.background - ±âº»°ª:"#FFFFFFFF"
					// this.articleXML
					// this.recommandXML
					// this.thumbnailURL
					// this.playtime - ±âº»°ª:00:00
					// this.disableArticleInfoPanel - ±âº»°ª:false
					// this.disableMovieListPanel - ±âº»°ª:false
					// this.disableScrapButton - ±âº»°ª:false
					// this.disableOtherMovieButton - ±âº»°ª:false
					//
					this.playtime = secondsToString(this.playtime);
					
					var alertErr = false;
					var err = "½Ç¹ö¶óÀÌÆ® ÄÁÆ®·Ñ¿¡¼­ ¿¡·¯°¡ ¹ß»ýÇß½À´Ï´Ù.    \n";
					err += "¸Þ¼­µå:createControl   \n";
					if (this.ID == undefined || this.ID == null || this.ID == "")
					{
						err += "¸Þ½ÃÁö:strID ¹ÌÀÔ·Â   \n";
						alertErr = true;
					}
					if (this.XAMLURL == undefined || this.XAMLURL == null || this.XAMLURL == "")
					{
						err += "¸Þ½ÃÁö:strXAMLURL ¹ÌÀÔ·Â   \n";
						alertErr = true;
					}
					
					if (alertErr == true) 
					{
						alert(err);
						return err.replace("\n", "<br>");
					}
					var strHref = document.location.href.toLowerCase();
					var channelTargetURL= "channel.nexon.com";
					var plusTargetURL= "plus.nexon.com";
					var geTag = "";
					if(strHref.indexOf(channelTargetURL) != -1)
					{
						geTag = "<div style='width:626px;height:529px;margin-bottom:0 auto 15px auto;'>"
					}
					else if(strHref.indexOf(plusTargetURL) != -1)
					{
						geTag = "<div style='height:514px;margin-bottom:0 auto 15px auto;'>";
					}
					else
					{
						geTag = "<div style='width:626px;height:529px;margin-bottom:0 auto 15px auto;'>";
					}

					document.getElementById(this.parentID).innerHTML = 
					geTag +
					Silverlight.createObjectEx({
						source: this.XAMLURL,
						parentElement: document.getElementById(this.hostID),
						id: this.ID,
						properties: {
							width: "100%",
							height: "100%",
							isWindowless: this.bWindowless == true ? "true" : "false",
							background: this.background,
							version: "1.0.21115"
						},
						events: {
							onLoad: Silverlight.createDelegate(scene, scene.handleLoad),
							onError: Silverlight.createDelegate(scene, scene.handleError)
						},
						context: {
							articleXML: this.articleXML,
							recommandXML: this.recommandXML,
							movieURL: this.movieURL,
							fontURL: this.fontURL,
							thumbnailURL: this.thumbnailURL,
							playtime: this.playtime,
							previewThumbList : this.previewThumbList,
							previewPlayTimeList : this.previewPlayTimeList,
							disableArticleInfoPanel: this.disableArticleInfoPanel,
							disableMovieListPanel: this.disableMovieListPanel,
							disableScrapButton: this.disableScrapButton,
							disableOtherMovieButton: this.disableOtherMovieButton,
							showAdText:this.showAdText,
							showAdMovie:this.showAdMovie,
							showAdTextLink:this.showAdTextLink,
							showAdMovieLink:this.showAdMovieLink,
							ableCategory:this.ableCategory,
							isShowStartLogo:this.isShowStartLogo,
							showStartLogoUrl:this.showStartLogoUrl
						}
					})
					+ "</div>";
				break;
					case "not installed" :
					countMovie = "1";
					var installInterval = setInterval(checkInstallFunc,1000);
					silverlightInstallLog("NotInstalled");
					if(navigator.userAgent.toLowerCase().indexOf("mac") == -1)
					{
						var renderHtml = '<div style="margin:0 auto;width:426px;position:relative;text-align:left;">';
						renderHtml += '<img src="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/global/bg_player.gif" width="426" height="380" alt="³Ø½¼ÇÃ·¹ÀÌ¾î ½ºÅ²" style="position:absolute;top: 0;left:0;"/>';
						renderHtml += '<a href="http://silverlight.dlservice.microsoft.com/download/C/5/B/C5BB5CD8-E871-49AC-8A40-61010E1FD1CF/Silverlight.exe" onclick="silverlightInstallLog(\'ClickInstall\');"><img src="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/global/img_silverlight_install1.gif" width="358" height="116" alt="Install Silverlight" style="position:absolute;margin:117px 0 0 34px;" border="0" /></a>';
						renderHtml += '<div style="width:426px;height:380px;margin-bottom:20px;"><img src="'+this.thumbnailURL+'" width="400" height="300" alt="³Ø½¼ÇÃ·¹ÀÌ¾î¸¦ »ç¿ëÇÏ±â À§ÇØ¼­´Â ½Ç¹ö¶óÀÌÆ®¸¦ ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù." style="vertical-align:top;margin:25px 0 0 13px;"/></div>';
						renderHtml += '</div>';
						document.getElementById(this.parentID).innerHTML = renderHtml;
					}
					else
					{
						var renderHtml = '<div style="margin:0 auto;width:426px;position:relative;text-align:left;">';
						renderHtml += '<img src="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/global/bg_player.gif" width="426" height="380" alt="³Ø½¼ÇÃ·¹ÀÌ¾î ½ºÅ²" style="position:absolute;top: 0;left:0;"/>';
						renderHtml += '<a href="http://silverlight.dlservice.microsoft.com/download/C/5/B/C5BB5CD8-E871-49AC-8A40-61010E1FD1CF/Silverlight.dmg" onclick="silverlightInstallLog(\'ClickInstall\');"><img src="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/global/img_silverlight_install1.gif" width="358" height="116" alt="Install Silverlight" style="position:absolute;margin:117px 0 0 34px;" border="0" /></a>';
						renderHtml += '<div style="width:426px;height:380px;margin-bottom:20px;"><img src="'+this.thumbnailURL+'" width="400" height="300" alt="³Ø½¼ÇÃ·¹ÀÌ¾î¸¦ »ç¿ëÇÏ±â À§ÇØ¼­´Â ½Ç¹ö¶óÀÌÆ®¸¦ ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù." style="vertical-align:top;margin:25px 0 0 13px;"/></div>';
						renderHtml += '</div>';
						document.getElementById(this.parentID).innerHTML = renderHtml;
					}
				break;
				case "not supported" :
					MP = new MediaPlayer();
					if ( NgbBrowser.msie() )
					{
						MP.ClientID		= this.ID;
						MP.n4Width = this.mediaPlayerWidth;
						MP.n4Height = this.mediaPlayerHeight;
						MP.ajaxMovieURL = this.ajaxMovieURL;
						document.getElementById(this.parentID).innerHTML = MP.Write();
						MP.versionCheck(MP.ClientID);						
					} 
					
					MP.LoadFile( this.movieFileInfo, this.ID, this.oidBoard, this.oidArticle, this.parentID );
				break;
			}
		}
    }
}


if (!window.Silverlight) 
	window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
	return function() {
		return method.apply(instance, arguments);
	}
}


if (!window.NxPlayer)
	NxPlayer = {};

NxPlayer.Page = function() 
{
}

NxPlayer.Page.prototype =
{
	handleError : function( rootElement, eventArgs )
	{
	},
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		this.root = rootElement;
		this.userContext = userContext;
		this.downloadFont(userContext.fontURL);

		this.checkAndInitParams();
		this.initControls();
		this.requestXML();
		this.addEventHandler();
		this.isMovieDownload = 0;
	},
	checkAndInitParams: function()
	{
		this.previewThumbList = this.userContext.previewThumbList;
		this.previewPlayTimeList = this.userContext.previewPlayTimeList;
        // UI ºñÈ°¼ºÈ­ ¿É¼Ç
        this.disableArticleInfoPanel = this.userContext.disableArticleInfoPanel;
        this.disableMovieListPanel = this.userContext.disableMovieListPanel;
        this.disableScrapButton = this.userContext.disableScrapButton;
        this.disableOtherMovieButton = this.userContext.disableOtherMovieButton;
        this.disableThumbnailImage = false; // ´ëÇ¥ÀÌ¹ÌÁö
		//µ¿¿µ»óÃ³¸®
		this.showAdText = this.userContext.showAdText;
		this.showAdMovie = this.userContext.showAdMovie;
		this.showAdTextLink = this.userContext.showAdTextLink;
		this.showAdMovieLink = this.userContext.showAdMovieLink;
		this.isPlayedAdMove = false;

		this.ableCategory = this.userContext.ableCategory;
		this.isShowStartLogo = this.userContext.isShowStartLogo;
		this.showStartLogoUrl = this.userContext.showStartLogoUrl;
		
		
		this.strArticleTitle ="";
		this.category ="";
		this.strNickName ="";
		this.strMovieFileURL ="";
		this.dateCreate ="";
		this.strArticleURL ="";
		this.strChannelURL ="";
		this.n4ReadCount ="";
		this.n4RecommandCount ="0";
		this.n4RecommandPoint ="0";
		this.isMovieDownload ="";
		this.isShowTextAd = false;
		this.isPlayingEnding = false;
		this.isPastXML = false;


        // ¿É¼Ç °ü°è Ã³¸®
        if (Invalid(this.userContext.articleXML))
        {
            this.disableArticleInfoPanel = true;
            this.disableScrapButton = true;
            this.disableOtherMovieButton = true;
        }
        if (Invalid(this.userContext.recommandXML))
        {
            this.disableMovieListPanel = true;
        }
        
        // ÀÏ¹Ý µ¥ÀÌÅÍ (»ç¿ëÇÏ´Â °÷¿¡¼­ »óÈ²¿¡ ¸Â°Ô ÀÚÃ¼ Ã³¸®)
        this.strThumbnailURL = this.userContext.thumbnailURL;

        if (Invalid(this.userContext.thumbnailURL))
        {
            this.disableThumbnailImage = true;
        }
        this.playtime = this.userContext.playtime;
	},
	initControls: function()
	{
		this.canvasRoot = this.getControl("Page");

		this.panPreview = this.getControl("panPreview");
		this.Background = this.getControl("Background");
	
		this.txtMessage = this.getControl("txtMessage");
		this.panAdvertisement = this.getControl("panAdvertisement");

		this.matrial = this.getControl("matrial");
		this.panEnding = this.getControl("panEnding");
		this.panScrap = this.getControl("panScrap");
		this.panMessage = this.getControl("panMessage");
		this.MovieList_Area = this.getControl("MovieList_Area");
		
		this.adScreen = this.getControl("adScreen");
		this.medScreen = this.getControl("medScreen");
		this.logoScreen = this.getControl("logoScreen");
		
		this.panbuffering = this.getControl("panbuffering");
		
		this.imgCapture = this.getControl("imgCapture");
		this.panMovieInfo = this.getControl("panMovieInfo");
		
		this.txtSubScription = this.getControl("txtSubScription");
		this.txtAuthor = this.getControl("txtAuthor");
		this.txtWrittenDate = this.getControl("txtWrittenDate");
		this.txtHitCount = this.getControl("txtHitCount");
		this.rctStarScoreProgress = this.getControl("rctStarScoreProgress");

		this.panController = this.getControl("panController");
		this.StartPanel = this.getControl("StartPanel");
		this.btnStart = this.getControl("btnStart");

		this.btnPlay = this.getControl("btnPlay");
		this.btnPause = this.getControl("btnPause");
		this.btnStop = this.getControl("btnStop");
		
		this.txtDuration = this.getControl("txtDuration");
		this.timer = this.getControl("timer");
		this.txtPosition = this.getControl("txtPosition");
		this.panProcessbar = this.getControl("panProcessbar");
		this.btnProgressArea =  this.getControl("btnProgressArea");
		this.rctBackground = this.getControl("rctBackground");
		this.rctDownload = this.getControl("rctDownload");
		this.rctProgress = this.getControl("rctProgress");
		this.btnProgress = this.getControl("btnProgress");
		
		//explorer
		this.panPreview = this.getControl("panPreview");
		this.rctPreviewOpenHitArea = this.getControl("rctPreviewOpenHitArea");
		
		this.rctPreviewHitArea21 = this.getControl("rctPreviewHitArea21");
		this.txtPreviewTime21 = this.getControl("txtPreviewTime21");
		this.img21 = this.getControl("img21");

		this.rctPreviewHitArea22 = this.getControl("rctPreviewHitArea22");
		this.txtPreviewTime22 = this.getControl("txtPreviewTime22");
		this.img22 = this.getControl("img22");

		this.rctPreviewHitArea23 = this.getControl("rctPreviewHitArea23");
		this.txtPreviewTime23 = this.getControl("txtPreviewTime23");
		this.img23 = this.getControl("img23");

		this.rctPreviewHitArea24 = this.getControl("rctPreviewHitArea24");
		this.txtPreviewTime24 = this.getControl("txtPreviewTime24");
		this.img24 = this.getControl("img24");

		this.rctPreviewHitArea25 = this.getControl("rctPreviewHitArea25");
		this.txtPreviewTime25 = this.getControl("txtPreviewTime25");
		this.img25 = this.getControl("img25");

		this.rctPreviewHitArea26 = this.getControl("rctPreviewHitArea26");
		this.txtPreviewTime26 = this.getControl("txtPreviewTime26");
		this.img26 = this.getControl("img26");

		//Volume Control
		this.ctlVolume = this.getControl("ctlVolume");
		this.rctVolumeBackground = this.getControl("rctVolumeBackground");
		this.rctVolumeProgress = this.getControl("rctVolumeProgress");
		this.onStatusVolume = this.getControl("icon_sound_On");
		this.muteStatusVolume = this.getControl("icon_sound_Off");
		this.btnVolume = this.getControl("btnVolume");
		this.panVolumebar = this.getControl("panVolumebar");
		
		//ending contents
		this.panRecommendPanel = this.getControl("panRecommendPanel");
		this.btnReplay = this.getControl("btnReplay");
		this.btnOtherMovie = this.getControl("btnOtherMovie");
		this.rctEndHitArea31 = this.getControl("rctEndHitArea31");
		this.rctEndHitArea32 = this.getControl("rctEndHitArea32");
		this.rctEndHitArea33 = this.getControl("rctEndHitArea33");
		this.img31 = this.getControl("img31");
		this.txtMovieTitle31 = this.getControl("txtMovieTitle31");
		this.img32 = this.getControl("img32");
		this.txtMovieTitle32 = this.getControl("txtMovieTitle32");
		this.img33 = this.getControl("img33");
		this.txtMovieTitle33 = this.getControl("txtMovieTitle33");
		this.rctArrowLeftArea = this.getControl("rctArrowLeftArea");
		this.rctArrowRightArea = this.getControl("rctArrowRightArea");
		
		//otherMovie
		this.show_panMovieList =  this.getControl("show_panMovieList");
		this.panMovieList = this.getControl("showEndingPanel");
		this.btnOpenMovieList = this.getControl("btnOpenMovieList");
		this.rctOtherHitArea11 = this.getControl("rctOtherHitArea11");
		this.txtTitle11 = this.getControl("txtTitle11");
		this.img11 = this.getControl("img11");
		this.rctOtherHitArea12 = this.getControl("rctOtherHitArea12");
		this.txtTitle12 = this.getControl("txtTitle12");
		this.img12 = this.getControl("img12");
		this.rctOtherHitArea13 = this.getControl("rctOtherHitArea13");
		this.txtTitle13 = this.getControl("txtTitle13");
		this.img13 = this.getControl("img13");
		this.rctOtherHitArea14 = this.getControl("rctOtherHitArea14");
		this.txtTitle14 = this.getControl("txtTitle14");
		this.img14 = this.getControl("img14");
		this.rctOtherHitArea15 = this.getControl("rctOtherHitArea15");
		this.txtTitle15 = this.getControl("txtTitle15");
		this.img15 = this.getControl("img15");
		this.rctOtherHitArea16 = this.getControl("rctOtherHitArea16");
		this.txtTitle16 = this.getControl("txtTitle16");
		this.img16 = this.getControl("img16");
		this.btnMovieList = this.getControl("btnMovieList");
		//scrap
		this.panScrap = this.getControl("panScrap");
		this.btnScrapClose = this.getControl("btnScrapClose");
		this.btnScrapCopy01 = this.getControl("btnScrapCopy01");
		this.btnScrapCopy01_rollover = this.getControl("btnScrapCopy01_rollover");
		this.txtScrapLink1 = this.getControl("txtScrapLink1");
		this.btnScrapCopy02 = this.getControl("btnScrapCopy02");
		this.btnScrapCopy02_rollover = this.getControl("btnScrapCopy02_rollover");
		this.txtScrapLink2 = this.getControl("txtScrapLink2");
		this.showScrapPanel = this.getControl("showScrapPanel");
		this.btnMessageConfirm = this.getControl("btnMessageConfirm");
		this.btnMessageConfirm_rollover = this.getControl("btnMessageConfirm_rollover");
		this.showMessagePanel = this.getControl("showMessagePanel");
		
		this.btnFullScreen = this.getControl("btnFullScreen");
		this.btnDownload = this.getControl("btnDownload");
		this.btnScrap = this.getControl("btnScrap");
		this.currrentVolume = (this.btnVolume["Canvas.Left"]  - this.panVolumebar["Canvas.Left"]) / (this.rctVolumeBackground.width - 20);
		this.currrentBtnVolume = this.btnVolume["Canvas.Left"];
		
		//progress bar Object
		this.rootClip = this.root.clip;
		this.btnVolumeMouseDown = false;
		this.counter1= 0;   // Media Download Progress ¿ë
		this.counter2= 0;

		//preview Set
		if( this.previewThumbList == "")
		{
			this.disablePreviewPanel = true;
			this.panPreview.Visibility = "Collapsed";
		}
		else
		{
			var previewThumbListArray = this.previewThumbList.split(",");
			var previewPlayTimeListArray = this.previewPlayTimeList.split(",");
			if(previewThumbListArray.length != 6 && previewPlayTimeListArray.length != 6 )
			{
				this.disablePreviewPanel = true;
			}
			else
			{
				this.img21.source = previewThumbListArray[0];
				this.txtPreviewTime21.text = secondsToString(previewPlayTimeListArray[0]);
				this.img22.source = previewThumbListArray[1];
				this.txtPreviewTime22.text = secondsToString(previewPlayTimeListArray[1]);
				this.img23.source = previewThumbListArray[2];
				this.txtPreviewTime23.text = secondsToString(previewPlayTimeListArray[2]);
				this.img24.source = previewThumbListArray[3];
				this.txtPreviewTime24.text = secondsToString(previewPlayTimeListArray[3]);
				this.img25.source = previewThumbListArray[4];
				this.txtPreviewTime25.text = secondsToString(previewPlayTimeListArray[4]);
				this.img26.source = previewThumbListArray[5];
				this.txtPreviewTime26.text = secondsToString(previewPlayTimeListArray[5]);
			}
		}

		this.imgCapture.source = this.strThumbnailURL;
		this.txtDuration.text = this.playtime;
		this.txtPosition.text = "00:00";
		
		this.isOpenMovieList = false;
		this.firstStart = true;
		this.btnProgressMouseDown = false;
		this.rctDownload.width = 0;
		this.rctProgress.width = 0;
		this.btnProgress["Canvas.Left"] = 0;
		this.progressWidth = this.rctBackground.width;
		this.progressButtonBase = this.btnProgress["Canvas.Left"];


		
		this.PageOriginWidth = this.canvasRoot.width;
		this.PageOriginHeight = this.canvasRoot.height;

	},
	requestXML: function()
	{
		if (this.disableArticleInfoPanel == false)
        {
            this.httpRequest1 = getXMLHttpRequest(); 
            sendRequest(this.httpRequest1, this.userContext.articleXML, null, Silverlight.createDelegate(this, this.ArticleXMLLoadComplete), "GET");
        }
		else
		{
			this.panMovieInfo.Visibility = "Collapsed";
		}
        
        // ÃßÃµ¿µ»ó Á¤º¸
        if (this.disableMovieListPanel == false)
        {
            this.httpRequest2 = getXMLHttpRequest();
            sendRequest(this.httpRequest2, this.userContext.recommandXML, null, Silverlight.createDelegate(this, this.RecommandXMLLoadComplete), "GET");
        }
		else
		{
			this.panRecommendPanel.Visibility = "Collapsed";
		}
	},
	downloadFont: function(fontURL)
    {
        // Font downloader
		var downloader = this.control.createObject("downloader");
	
		downloader.addEventListener("Completed", Silverlight.createDelegate(this, this.handleDownloadCompleted));
		downloader.open("GET", fontURL);
		downloader.send();
    },
	addEventHandler: function()
	{
		this.canvasRoot.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.canvasRoot_MouseLeave));
		this.canvasRoot.addEventListener("KeyDown", Silverlight.createDelegate(this, this.canvasRoot_KeyDown));

		this.btnPlay.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnPlay_MouseEnter));
		this.btnPlay.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnPlay_MouseLeave));
		this.btnPlay.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnPlay_MouseLeftButtonDown));
		this.btnStart.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnStart_MouseEnter));
		this.btnStart.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnStart_MouseLeave));
		this.btnStart.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnStart_MouseLeftButtonDown));
		this.btnPause.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnPause_MouseEnter));
		this.btnPause.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnPause_MouseLeave));
		this.btnPause.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnPause_MouseLeftButtonDown));
		this.btnStop.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnStop_MouseEnter));
		this.btnStop.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnStop_MouseLeave));
		this.btnStop.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnStop_MouseLeftButtonDown));
		
		this.medScreen.addEventListener("MediaOpened", Silverlight.createDelegate(this, this.medScreen_MediaOpened));
		this.medScreen.addEventListener("MediaEnded", Silverlight.createDelegate(this, this.medScreen_MediaEnded));
		this.medScreen.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.medScreen_DownloadProgressChanged));
		this.medScreen.addEventListener("BufferingProgressChanged", Silverlight.createDelegate(this, this.medScreen_BufferingProgressChanged));
		this.medScreen.addEventListener("CurrentStateChanged", Silverlight.createDelegate(this, this.medScreen_CurrentStateChanged));
		this.medScreen.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.medScreen_MouseEnter));

		this.adScreen.addEventListener("MediaEnded", Silverlight.createDelegate(this, this.adScreen_MediaEnded));
		this.adScreen.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.adScreen_MouseLeftButtonDown));
		
		this.logoScreen.addEventListener("MediaEnded", Silverlight.createDelegate(this, this.logoScreen_MediaEnded));
//		this.medScreen.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.medScreen_MouseLeave));

		if(!this.disablePreviewPanel)
		{
			this.rctPreviewOpenHitArea.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctPreviewOpenHitArea_MouseEnter));
			this.rctPreviewHitArea21.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.preview001_MouseEnter));
			this.rctPreviewHitArea21.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.preview001_MouseLeave));
			this.rctPreviewHitArea21.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.preview001_MouseLeftButtonDown));
			this.rctPreviewHitArea22.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.preview002_MouseEnter));
			this.rctPreviewHitArea22.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.preview002_MouseLeave));
			this.rctPreviewHitArea22.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.preview002_MouseLeftButtonDown));
			this.rctPreviewHitArea23.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.preview003_MouseEnter));
			this.rctPreviewHitArea23.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.preview003_MouseLeave));
			this.rctPreviewHitArea23.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.preview003_MouseLeftButtonDown));
			this.rctPreviewHitArea24.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.preview004_MouseEnter));
			this.rctPreviewHitArea24.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.preview004_MouseLeave));
			this.rctPreviewHitArea24.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.preview004_MouseLeftButtonDown));
			this.rctPreviewHitArea25.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.preview005_MouseEnter));
			this.rctPreviewHitArea25.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.preview005_MouseLeave));
			this.rctPreviewHitArea25.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.preview005_MouseLeftButtonDown));
			this.rctPreviewHitArea26.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.preview006_MouseEnter));
			this.rctPreviewHitArea26.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.preview006_MouseLeave));
			this.rctPreviewHitArea26.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.preview006_MouseLeftButtonDown));
		}

		this.btnVolume.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnVolume_MouseLeftButtonDown));
		this.btnVolume.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.btnVolume_MouseLeftButtonUp));
		this.btnVolume.addEventListener("MouseMove", Silverlight.createDelegate(this, this.btnVolume_MouseMove));
		this.rctVolumeBackground.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctVolumeBackground_MouseLeftButtonDown));
		this.rctVolumeProgress.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctVolumeProgress_MouseLeftButtonDown));
		this.getControl("btnVolumeMuteHit").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnVolumeMute_MouseLeftButtonDown));
		
		this.btnFullScreen.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnFullScreen_MouseEnter));
		this.btnFullScreen.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnFullScreen_MouseLeave));
		this.btnFullScreen.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnFullScreen_MouseLeftButtonDown));
		
		this.btnDownload.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnDownload_MouseEnter));
		this.btnDownload.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnDownload_MouseLeave));
		this.btnDownload.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnDownload_MouseLeftButtonDown));
		
		if(!this.disableScrapButton)
		{
			this.btnScrap.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnScrap_MouseEnter));
			this.btnScrap.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnScrap_MouseLeave));
			this.btnScrap.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnScrap_MouseLeftButtonDown));
			this.btnScrapClose.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnScrapClose_MouseEnter));
			this.btnScrapClose.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnScrapClose_MouseLeave));
			this.btnScrapClose.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnScrapClose_MouseLeftButtonDown));
			this.btnScrapCopy01.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnScrapCopy01_MouseEnter));
			this.btnScrapCopy01.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnScrapCopy01_MouseLeave));
			this.btnScrapCopy01.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnScrapCopy01_MouseLeftButtonDown));
			this.btnScrapCopy02.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnScrapCopy02_MouseEnter));
			this.btnScrapCopy02.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnScrapCopy02_MouseLeave));
			this.btnScrapCopy02.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnScrapCopy02_MouseLeftButtonDown));
			this.btnMessageConfirm.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnMessageConfirm_MouseEnter));
			this.btnMessageConfirm.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnMessageConfirm_MouseLeave));
			this.btnMessageConfirm.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnMessageConfirm_MouseLeftButtonDown));
		}
		else
		{
			this.btnScrap.cursor = "Arrow";
			this.btnScrap.opacity = 0.5;
		}

		this.btnProgress.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnProgress_MouseLeftButtonDown));
		this.btnProgress.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.btnProgress_MouseLeftButtonUp));
		this.btnProgress.addEventListener("MouseMove", Silverlight.createDelegate(this, this.btnProgress_MouseMove));
		
		this.rctBackground.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctBackground_MouseLeftButtonDown));
		this.rctDownload.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctBackground_MouseLeftButtonDown));
		this.rctProgress.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctBackground_MouseLeftButtonDown));

		this.timer.addEventListener("Completed", Silverlight.createDelegate(this, this.timer_Completed));
		
		this.btnReplay.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnReplay_MouseEnter));
		this.btnReplay.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnReplay_MouseLeave));
		this.btnReplay.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnReplay_MouseLeftButtonDown));

		this.btnOtherMovie.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnOtherMovie_MouseEnter));
		this.btnOtherMovie.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnOtherMovie_MouseLeave));
		this.btnOtherMovie.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnOtherMovie_MouseLeftButtonDown));

		this.rctEndHitArea32.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctEndHitArea32_MouseEnter));
		this.rctEndHitArea32.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.rctEndHitArea32_MouseLeave));
		this.rctEndHitArea32.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctEndHitArea32_MouseLeftButtonDown));
		this.rctArrowLeftArea.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctArrowLeftArea_MouseEnter));
		this.rctArrowLeftArea.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.rctArrowLeftArea_MouseLeave));
		this.rctArrowLeftArea.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctArrowLeftArea_MouseLeftButtonDown));
		this.rctArrowRightArea.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctArrowRightArea_MouseEnter));
		this.rctArrowRightArea.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.rctArrowRightArea_MouseLeave));
		this.rctArrowRightArea.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctArrowRightArea_MouseLeftButtonDown));
		this.btnOpenMovieList.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnOpenMovieList_MouseLeftButtonDown));

		this.show_panMovieList.addEventListener("Completed", Silverlight.createDelegate(this, this.btnOpenMovieList_Completed));
		this.rctOtherHitArea11.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctOtherHitArea11_MouseEnter));
		this.rctOtherHitArea11.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.rctOtherHitArea11_MouseLeave));
		this.rctOtherHitArea11.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctOtherHitArea11_MouseLeftButtonDown));
		this.rctOtherHitArea12.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctOtherHitArea12_MouseEnter));
		this.rctOtherHitArea12.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.rctOtherHitArea12_MouseLeave));
		this.rctOtherHitArea12.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctOtherHitArea12_MouseLeftButtonDown));
		this.rctOtherHitArea13.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctOtherHitArea13_MouseEnter));
		this.rctOtherHitArea13.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.rctOtherHitArea13_MouseLeave));
		this.rctOtherHitArea13.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctOtherHitArea13_MouseLeftButtonDown));
		this.rctOtherHitArea14.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctOtherHitArea14_MouseEnter));
		this.rctOtherHitArea14.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.rctOtherHitArea14_MouseLeave));
		this.rctOtherHitArea14.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctOtherHitArea14_MouseLeftButtonDown));
		this.rctOtherHitArea15.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctOtherHitArea15_MouseEnter));
		this.rctOtherHitArea15.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.rctOtherHitArea15_MouseLeave));
		this.rctOtherHitArea15.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctOtherHitArea15_MouseLeftButtonDown));
		this.rctOtherHitArea16.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.rctOtherHitArea16_MouseEnter));
		this.rctOtherHitArea16.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.rctOtherHitArea16_MouseLeave));
		this.rctOtherHitArea16.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.rctOtherHitArea16_MouseLeftButtonDown));
		this.btnMovieList.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.btnMovieList_MouseEnter));
		this.btnMovieList.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.btnMovieList_MouseLeave));
		this.btnMovieList.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.btnMovieList_MouseLeftButtonDown));

		this.panAdvertisement.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.panAdvertisement_MouseLeftButtonDown));


		this.control.content.onFullScreenChange = Silverlight.createDelegate(this, this.BrowserHost_FullScreenChange);
	},
	btnMovieList_MouseEnter: function(sender, args) { this.getControl("btnMovieList_rollover").Begin();},
	btnMovieList_MouseLeave: function(sender, args) { this.getControl("btnMovieList_rollover").Stop();},
	btnMovieList_MouseLeftButtonDown: function(sender, args)
	{ 
		if(!this.isOpenMovieList)
		{
			this.getControl("show_panMovieList").Begin();	
			this.isOpenMovieList = true;
		}
		else
		{
			this.getControl("hide_panMovieList").Begin();	
			this.medScreen.height=450;
			this.medScreen["Canvas.Top"]=24;
			this.medScreen.Stretch = "Fill";
			this.isOpenMovieList = false;
		}
	},
	rctOtherHitArea11_MouseEnter: function(sender, args) { this.getControl("thumbOther01_rollover").Begin();},
	rctOtherHitArea12_MouseEnter: function(sender, args) { this.getControl("thumbOther02_rollover").Begin();},
	rctOtherHitArea13_MouseEnter: function(sender, args) { this.getControl("thumbOther03_rollover").Begin();},
	rctOtherHitArea14_MouseEnter: function(sender, args) { this.getControl("thumbOther04_rollover").Begin();},
	rctOtherHitArea15_MouseEnter: function(sender, args) { this.getControl("thumbOther05_rollover").Begin();},
	rctOtherHitArea16_MouseEnter: function(sender, args) { this.getControl("thumbOther06_rollover").Begin();},
	rctOtherHitArea11_MouseLeave: function(sender, args) { this.getControl("thumbOther01_rollover").Stop();this.getControl("thumbOther01_rollout").Begin();},
	rctOtherHitArea12_MouseLeave: function(sender, args) { this.getControl("thumbOther02_rollover").Stop();this.getControl("thumbOther02_rollout").Begin();},
	rctOtherHitArea13_MouseLeave: function(sender, args) { this.getControl("thumbOther03_rollover").Stop();this.getControl("thumbOther03_rollout").Begin();},
	rctOtherHitArea14_MouseLeave: function(sender, args) { this.getControl("thumbOther04_rollover").Stop();this.getControl("thumbOther04_rollout").Begin();},
	rctOtherHitArea15_MouseLeave: function(sender, args) { this.getControl("thumbOther05_rollover").Stop();this.getControl("thumbOther05_rollout").Begin();},
	rctOtherHitArea16_MouseLeave: function(sender, args) { this.getControl("thumbOther06_rollover").Stop();this.getControl("thumbOther06_rollout").Begin();},
	rctOtherHitArea11_MouseLeftButtonDown: function(sender, args){if(this.otherMovieList[0].articleURL && this.otherMovieList[0].articleURL != "")document.location = this.otherMovieList[0].articleURL;},
	rctOtherHitArea12_MouseLeftButtonDown: function(sender, args){if(this.otherMovieList[1].articleURL && this.otherMovieList[1].articleURL != "")document.location = this.otherMovieList[1].articleURL;},
	rctOtherHitArea13_MouseLeftButtonDown: function(sender, args){if(this.otherMovieList[2].articleURL && this.otherMovieList[2].articleURL != "")document.location = this.otherMovieList[2].articleURL;},
	rctOtherHitArea14_MouseLeftButtonDown: function(sender, args){if(this.otherMovieList[3].articleURL && this.otherMovieList[3].articleURL != "")document.location = this.otherMovieList[3].articleURL;},
	rctOtherHitArea15_MouseLeftButtonDown: function(sender, args){if(this.otherMovieList[4].articleURL && this.otherMovieList[4].articleURL != "")document.location = this.otherMovieList[4].articleURL;},
	rctOtherHitArea16_MouseLeftButtonDown: function(sender, args){if(this.otherMovieList[5].articleURL && this.otherMovieList[5].articleURL != "")document.location = this.otherMovieList[5].articleURL;},
	btnOpenMovieList_MouseLeftButtonDown: function(sender, args)
	{
		if(!this.isOpenMovieList)
		{
				this.getControl("show_panMovieList").Begin();	
				this.isOpenMovieList = true;
		}
		else
		{
			this.getControl("hide_panMovieList").Begin();	
			this.medScreen.height=450;
			this.medScreen["Canvas.Top"]=24;
			this.medScreen.Stretch = "Fill";
			this.isOpenMovieList = false;
		}
	},
	btnOpenMovieList_Completed: function(sender, args)
	{
			this.medScreen.height=335;
			this.medScreen["Canvas.Top"]=139;
			this.medScreen.Stretch = "Fill";
	},	
	rctArrowLeftArea_MouseEnter:function(sender, args) {this.getControl("arrowLeft_rollover").Begin();},
	rctArrowLeftArea_MouseLeave:function(sender, args) {this.getControl("arrowLeft_rollover").Stop();},
	rctArrowLeftArea_MouseLeftButtonDown:function(sender, args) {
		this.recommand.IncreaseIndex(-4);
		this.setMovieList();
	},
	rctArrowRightArea_MouseEnter:function(sender, args) {this.getControl("arrowRight_rollover").Begin();},
	rctArrowRightArea_MouseLeave:function(sender, args) {this.getControl("arrowRight_rollover").Stop();},
	rctArrowRightArea_MouseLeftButtonDown:function(sender, args) {
		this.recommand.IncreaseIndex(-2);
		this.setMovieList();
	},
	rctEndHitArea32_MouseEnter: function(sender, args) {this.getControl("thumbEnd02_rollover").Begin();},
	rctEndHitArea32_MouseLeave: function(sender, args) {this.getControl("thumbEnd02_rollout").Begin();this.getControl("thumbEnd02_rollover").Stop();},
	rctEndHitArea32_MouseLeftButtonDown: function(sender, args) {document.location = this.movThumb02.articleURL;},
	handleDownloadCompleted: function(sender, args)
	{
	    // TextBlock°ú ´Ù¿î·Î´õ ¿¬°á
	    this.downloader = sender;
	    this.traversal(this.root, 0);
	},
	
	// TextBlock Àç±Í Å½»ö, thx gongdo
    traversal: function(target, depth)
	{
		var typeName = target.toString();
		if (!depth)
		{
			depth = 0;
		}

		if (typeName == 'Canvas')
		{
			for(var i=0; i<target.children.count; ++i)
			{
				this.traversal(target.children.getItem(i), depth + 1);
			}
		}
		else if (typeName == 'TextBlock')
		{
			// ´Ù¿î·Î´õ ¼¼ÆÃ, Á¢µÎ¾î°¡ "txt"·Î ¸í¸íµÈ ÅØ½ºÆ® ÄÁÆ®·Ñ¸¸ ÆùÆ® ¼öÁ¤
			if (target.name.substr(0, 3) == "txt")
			{
			    target.setFontSource(this.downloader);
			}
		}
	},
	//Play Control
	btnPlay_MouseEnter: function(sender, eventArgs){this.getControl("btnPlay_rollover").Begin();},
	btnPlay_MouseLeave: function(sender, eventArgs){this.getControl("btnPlay_rollover").Stop();},
	btnPlay_MouseLeftButtonDown: function(sender, eventArgs)
	{
		if(!this.isPlayingEnding)
		{
			this.playMovie();
		}
	},
	btnStart_MouseEnter: function(sender, eventArgs)
	{
		this.getControl("btnSrart_rollover").Begin();
	},
	btnStart_MouseLeave: function(sender, eventArgs)
	{
		this.getControl("btnSrart_rollover").Stop();
	},
	btnStart_MouseLeftButtonDown: function(sender, eventArgs)
	{
		this.playMovie();
	},
	logoScreen_MediaEnded: function()
	{
		this.getControl("restrictControl").visibility = "Collapsed";
		this.logoScreen.visibility = "Collapsed";
		this.medScreen.visibility = "Visible";
		if(!this.directMovieFileAcess)
		{
			this.getControl("logoScreen").source = "";
			this.httpRequest3 = getXMLHttpRequest();
			var randQuery = "&rand=" + Math.floor(Math.random() * 10000000);
			sendRequest(this.httpRequest3, this.userContext.movieURL + randQuery, null, Silverlight.createDelegate(this, this.MovieURLLoadComplete), "GET");
		}
		else
		{
			this.medScreen.source = this.userContext.movieURL;
			this.medScreen.autoPlay = true;
			if(this.firstStart == true && !this.disablePreviewPanel)
			{
				this.getControl("hidePreviewPanelFirst").begin();
			}
			this.firstStart == false;
		}
	},
	playMovie: function()
	{
		if(!this.directMovieFileAcess)
		{
			if(this.medScreen.source != "")
			{
				this.httpRequest3 = getXMLHttpRequest();
				var randQuery = "&rand=" + Math.floor(Math.random() * 10000000);
				sendRequest(this.httpRequest3, this.userContext.movieURL + randQuery, null, Silverlight.createDelegate(this, this.MovieURLLoadComplete), "GET");
			}
			else
			{
				if(this.isShowStartLogo)
				{
					if(this.logoScreen.Source == "")
					{
						try
						{
							this.logoScreen.Source = this.showStartLogoUrl.trim(); 
							this.logoScreen.visibility = "Visible";
							this.medScreen.visibility = "Collapsed";
							this.getControl("showEndingPanel").Stop();
							this.btnPause.Visibility = "Visible";
							this.btnPlay.Visibility = "Collapsed";
							this.imgCapture.visibility = "Collapsed";
							this.getControl("hideMovieInfo").Begin();
							this.panMovieInfo.Visibility = "Collapsed";
							this.getControl("hide_btnStart").Begin();
							this.StartPanel.Visibility = "Collapsed";

							this.getControl("restrictControl").visibility = "Visible";
							this.logoScreen.autoPlay = true;
							this.logoScreen.volume = 1;
							this.logoScreen.Play();
						}
						catch (e)
						{
							alert("·Î°í ¿µ»óÀÌ Àç»ýµÇÁö¾Ê¾Ò½À´Ï´Ù.");
							this.httpRequest3 = getXMLHttpRequest();
							var randQuery = "&rand=" + Math.floor(Math.random() * 10000000);
							sendRequest(this.httpRequest3, this.userContext.movieURL + randQuery, null, Silverlight.createDelegate(this, this.MovieURLLoadComplete), "GET");
						}
					}
				}
				else
				{
					this.httpRequest3 = getXMLHttpRequest();
					var randQuery = "&rand=" + Math.floor(Math.random() * 10000000);
					sendRequest(this.httpRequest3, this.userContext.movieURL + randQuery, null, Silverlight.createDelegate(this, this.MovieURLLoadComplete), "GET");
				}
			}
		}
		else
		{
			if( this.medScreen.source != "")
			{
				this.medScreen.Play();
			}
			else
			{
				this.medScreen.source = this.userContext.movieURL;
				this.medScreen.autoPlay = true;
				if(this.firstStart == true && !this.disablePreviewPanel)
				{
					this.getControl("hidePreviewPanelFirst").begin();
				}
				this.firstStart == false;
			}
		}
	},
	
	// µ¿¿µ»ó URL ÄÝ¹é
	MovieURLLoadComplete: function()
	{
		if (this.httpRequest3.readyState == 4)
		{
			if (this.httpRequest3.status == 200)
			{
				this.strMovieFileURL = unescape( this.httpRequest3.responseText.trim() );
				closeRequest(this.httpRequest3);
				if (this.strMovieFileURL.lastIndexOf("ERROR") != -1)	// ¿¡·¯
				{
					alert("µ¿¿µ»ó ¿­±â ¿¡·¯");
					return;
				}
				if( this.medScreen.source != "")
				{
					this.medScreen.Play();
				}
				else
				{					
					this.medScreen.source = this.strMovieFileURL;
					this.medScreen.autoPlay = true;
					if(this.firstStart == true && !this.disablePreviewPanel)
					{
						this.getControl("hidePreviewPanelFirst").Begin();
					}
					this.firstStart == false;
				}
			}
		}
	},
	rctPreviewOpenHitArea_MouseEnter : function(sender, eventArgs)
	{
		if(this.playerState == PlayerState.Playing)
		{
			this.getControl("hidePreviewPanelFirst").Stop();
			this.getControl("showPreviewPanel").Begin();
		}
	},
	medScreen_MouseEnter : function(sender, eventArgs)
	{
		if(this.playerState == PlayerState.Playing)
		{
			this.getControl("hidePreviewPanel").Begin();
		}
	},
	preview001_MouseEnter: function(sender, eventArgs) { this.getControl("thumbPreview01_rollover").Begin(); },
	preview002_MouseEnter: function(sender, eventArgs) { this.getControl("thumbPreview02_rollover").Begin(); },
	preview003_MouseEnter: function(sender, eventArgs) { this.getControl("thumbPreview03_rollover").Begin(); },
	preview004_MouseEnter: function(sender, eventArgs) { this.getControl("thumbPreview04_rollover").Begin(); },
	preview005_MouseEnter: function(sender, eventArgs) { this.getControl("thumbPreview05_rollover").Begin(); },
	preview006_MouseEnter: function(sender, eventArgs) { this.getControl("thumbPreview06_rollover").Begin(); },

	preview001_MouseLeave: function(sender, eventArgs) { this.getControl("thumbPreview01_rollover").Stop(); },
	preview002_MouseLeave: function(sender, eventArgs) { this.getControl("thumbPreview02_rollover").Stop(); },
	preview003_MouseLeave: function(sender, eventArgs) { this.getControl("thumbPreview03_rollover").Stop(); },
	preview004_MouseLeave: function(sender, eventArgs) { this.getControl("thumbPreview04_rollover").Stop(); },
	preview005_MouseLeave: function(sender, eventArgs) { this.getControl("thumbPreview05_rollover").Stop(); },
	preview006_MouseLeave: function(sender, eventArgs) { this.getControl("thumbPreview06_rollover").Stop(); },

	preview001_MouseLeftButtonDown: function(sender, eventArgs){ this.moveMoviePosition(stringToSeconds(this.txtPreviewTime21.text));},
	preview002_MouseLeftButtonDown: function(sender, eventArgs){ this.moveMoviePosition(stringToSeconds(this.txtPreviewTime22.text));},
	preview003_MouseLeftButtonDown: function(sender, eventArgs){ this.moveMoviePosition(stringToSeconds(this.txtPreviewTime23.text));},
	preview004_MouseLeftButtonDown: function(sender, eventArgs){ this.moveMoviePosition(stringToSeconds(this.txtPreviewTime24.text));},
	preview005_MouseLeftButtonDown: function(sender, eventArgs){ this.moveMoviePosition(stringToSeconds(this.txtPreviewTime25.text));},
	preview006_MouseLeftButtonDown: function(sender, eventArgs){ this.moveMoviePosition(stringToSeconds(this.txtPreviewTime26.text));},

	btnPause_MouseEnter: function(sender, eventArgs){this.getControl("btnPause_rollover").Begin();},
	btnPause_MouseLeave: function(sender, eventArgs){this.getControl("btnPause_rollover").Stop();},
	btnPause_MouseLeftButtonDown: function(sender, eventArgs)
	{
		var timeSpan = this.medScreen.position;
		this.medScreen.Pause();
		this.btnPause.Visibility = "Collapsed";
		this.btnPlay.Visibility = "Visible";
		this.imgCapture.visibility = "Collapsed";
		this.getControl("hideMovieInfo").Begin();
		this.panMovieInfo.Visibility = "Collapsed";
		this.getControl("hide_btnStart").Begin();
		this.StartPanel.Visibility = "Collapsed";
		
	},
	btnStop_MouseEnter: function(sender, eventArgs){this.getControl("btnStop_rollover").Begin();},
	btnStop_MouseLeave: function(sender, eventArgs){this.getControl("btnStop_rollover").Stop();},
	btnStop_MouseLeftButtonDown: function(sender, eventArgs)
	{
		this.btnPause.Visibility = "Collapsed";
		this.btnPlay.Visibility = "Visible";
		this.medScreen.Stop();
	},
	
	//Volume Control
	btnVolume_MouseLeftButtonDown: function(sender, eventArgs)
	{
		this.btnVolume.captureMouse();
		this.btnVolumeMouseDown = true;
		this.btnVolumeX = eventArgs.getPosition(this.rctVolumeBackground).x - this.btnVolume["Canvas.Left"];
		this.rctVolumeProgressWidth = this.rctVolumeBackground.width + this.panVolumebar["Canvas.Left"] - 20;
	},
	
	btnVolume_MouseLeftButtonUp: function(sender, eventArgs)
	{
		if (this.btnVolumeMouseDown == false) return;
		this.btnVolume.releaseMouseCapture();
		this.btnVolumeMouseDown = false;
		this.currrentVolume = (this.btnVolume["Canvas.Left"]  - this.panVolumebar["Canvas.Left"]) / (this.rctVolumeBackground.width - 20);
		this.currrentBtnVolume = this.btnVolume["Canvas.Left"];
		this.setVolume(this.currrentVolume);
	},
	btnVolume_MouseMove: function(sender, eventArgs)
	{
		if (this.btnVolumeMouseDown == false) return;
		var newLeft = eventArgs.getPosition(this.rctVolumeBackground).x - this.btnVolumeX;
		if (newLeft < this.panVolumebar["Canvas.Left"])
			newLeft = this.panVolumebar["Canvas.Left"];
		else if (newLeft > this.rctVolumeProgressWidth)
			newLeft = this.rctVolumeProgressWidth;
		this.btnVolume["Canvas.Left"] = newLeft;
	},
	rctVolumeBackground_MouseLeftButtonDown: function(sender, eventArgs)
	{
		this.currrentBtnVolume = eventArgs.getPosition(this.rctVolumeBackground).x + 28;
		if(this.currrentBtnVolume > 90) { this.currrentBtnVolume = 90 };
		this.setVolume(eventArgs.getPosition(this.rctVolumeBackground).x / (this.rctVolumeBackground.width - 20));
		this.currrentVolume = eventArgs.getPosition(this.rctVolumeBackground).x / (this.rctVolumeBackground.width - 20);
	},
	rctVolumeProgress_MouseLeftButtonDown: function(sender, eventArgs)
	{
		this.currrentBtnVolume = eventArgs.getPosition(this.rctVolumeBackground).x + 28;
		if(this.currrentBtnVolume > 90) { this.currrentBtnVolume = 90 };
		this.setVolume(eventArgs.getPosition(this.rctVolumeBackground).x / (this.rctVolumeBackground.width - 20));
		this.currrentVolume = eventArgs.getPosition(this.rctVolumeBackground).x / (this.rctVolumeBackground.width - 18);
	},
	setVolume: function(volume)
	{
		if(volume ==0)
		{
			this.onStatusVolume.Visibility = "Collapsed";
			this.muteStatusVolume.Visibility = "Visible";
			this.btnVolume["Canvas.Left"] = this.panVolumebar["Canvas.Left"];
		}
		else
		{
			this.onStatusVolume.Visibility = "Visible";
			this.muteStatusVolume.Visibility = "Collapsed";
			this.btnVolume["Canvas.Left"] = this.currrentBtnVolume;
		}
		this.medScreen.volume = volume;
		
		this.rctVolumeProgress.width = volume * (this.rctVolumeBackground.width - 20);
	},
	btnVolumeMute_MouseLeftButtonDown: function(sender, eventArgs)
	{
		if(this.onStatusVolume.Visibility == "Visible")
			this.setVolume("0");
		else
			this.setVolume(this.currrentVolume);
	},
	medScreen_BufferingProgressChanged: function(sender, eventArgs)
	{
		var progress = this.medScreen.bufferingProgress;
	},
	medScreen_MediaOpened: function(sender, eventArgs)
	{
		this.txtPosition.text = "00:00";
		this.firstStart = true;
		this.duration = this.medScreen.NaturalDuration.Seconds;
		var strDuration = secondsToString(this.duration);
		this.txtDuration.text = strDuration;
	},
	medScreen_MediaEnded: function(sender, eventArgs)
	{
		// Àç»ý ÁßÁö
		this.isMediaEnded = true;
		this.getControl("showPreviewPanel").Stop();

		this.txtPosition.text = "00:00";
		this.rctDownload.width = 0;
		this.rctProgress.width = 0;
		this.btnProgress["Canvas.Left"] = 0;

		if(this.isEndingMovie)
		{
			try
			{
				this.adScreen.Visibility = "Visible";
				this.medScreen.Visibility = "Collapsed";
				this.adScreen.source = this.endingAdArray[this.endingCount].movieUrl;
				this.adEndingLink = this.endingAdArray[this.endingCount].linkUrl;
				this.adEndingLinkType = this.endingAdArray[this.endingCount].linkTarget;
				this.adScreen.autoPlay = true;
				this.isPlayingEnding = true;
				this.endingCount++
			}
			catch (e)
			{
				alert("¿£µù ¿µ»óÀÌ Àç»ýµÇÁö ¾Ê¾Ò½À´Ï´Ù.");
				this.adScreen.source ="";
				this.adScreen.autoPlay = false;
				this.isPlayingEnding = false;
				
				this.mediaEndedProc();
			}
		}
		else
		{
			this.mediaEndedProc();
		}

	},
	adScreen_MediaEnded:function()
	{
		if(this.endingAdArray.length > this.endingCount)
		{
			try
			{
				this.adScreen.Visibility = "Visible";
				this.medScreen.Visibility = "Collapsed";
				this.adScreen.source = this.endingAdArray[this.endingCount].movieUrl;
				this.adEndingLink = this.endingAdArray[this.endingCount].linkUrl;
				this.adEndingLinkType = this.endingAdArray[this.endingCount].linkTarget;
				this.adScreen.autoPlay = true;
				this.isPlayingEnding = true;
				this.endingCount++
			}
			catch (e)
			{
				alert("¿£µù ¿µ»óÀÌ Àç»ýµÇÁö ¾Ê¾Ò½À´Ï´Ù.")
				this.adScreen.source ="";
				this.adScreen.autoPlay = false;
				this.isPlayingEnding = false;
				this.mediaEndedProc();
			}
		}
		else
		{
			this.medScreen.Visibility = "Visible";
			this.adScreen.Visibility = "Collapsed";
			this.isPlayingEnding = false;
			this.endingCount = 0
			this.mediaEndedProc();
		}
	},
	adScreen_MouseLeftButtonDown:  function(sender, eventArgs)
	{
		if(this.adEndingLinkType =="2")
		{
			window.open(this.adEndingLink);
		}
		else if(this.adEndingLinkType =="1")
		{
			document.location.href = this.adEndingLink;
		}
	},
	mediaEndedProc: function()
	{
		this.medScreen.stop();
		
		this.adScreen.source ="";
		this.adScreen.autoPlay = false;
		this.isPlayingEnding = false;
		this.getControl("hidePreviewPanelFirst").Stop();
		this.medScreen.source = "";
		if(this.isOpenMovieList)
		{
			this.getControl("hide_panMovieList").Begin();	
			this.medScreen.height=450;
			this.medScreen["Canvas.Top"]=24;
			this.medScreen.Stretch = "Fill";
			this.isOpenMovieList = false;
		}

		this.rctDownload.width = 0;
		this.rctProgress.width = 0;
		this.btnProgress["Canvas.Left"] = 0;

		this.imgCapture.Visibility = "Visible";
		this.getControl("hideMovieInfo").Begin();
		this.panMovieInfo.Visibility = "Collapsed";
		this.StartPanel.Visibility = "Collapsed";
		this.firstStart = true;
		this.getControl("showEndingPanel").Begin();
	},
	// µ¿¿µ»ó Àç»ý »óÅÂ º¯È­¿¡ µû¸¥ Ã³¸®
	medScreen_CurrentStateChanged: function(sender, eventArgs)
	{
		var state = this.medScreen.currentState;
		// Áßº¹ È£Ãâ ¹èÁ¦
		if (state == this.playerState) { return; }

		// ÀÌÀü »óÅÂ¿¡ µû¶ó
		switch (this.playerState)
		{
			case PlayerState.Playing:
			{
				this.btnFullScreen.cursor = "Arrow";
				break;
			}
			case PlayerState.Buffering:
			{
				this.getControl("mc_Buffering").Stop();
				this.panbuffering.visibility = "Collapsed";
				break;
			}
			default:
			{
				break;
			}
		}
		
		this.playerState = state;
		switch (state)
		{
			case PlayerState.Playing:   // "Playing":
			{
				this.getControl("showEndingPanel").Stop();
				this.btnPause.Visibility = "Visible";
				this.btnPlay.Visibility = "Collapsed";
				this.imgCapture.visibility = "Collapsed";
				this.getControl("hideMovieInfo").Begin();
				this.panMovieInfo.Visibility = "Collapsed";
				this.getControl("hide_btnStart").Begin();
				this.StartPanel.Visibility = "Collapsed";
				this.timer.begin();
				break;
			}
			case PlayerState.Buffering: // "Buffering":
			{
				this.panbuffering.Visibility = "Visible";
				this.getControl("mc_Buffering").Begin();
				break;
				
			}
			case PlayerState.Paused:	// "Paused":
			{
				this.btnPause.Visibility = "Collapsed";
				this.btnPlay.Visibility = "Visible";
				this.imgCapture.visibility = "Collapsed";
				this.getControl("hideMovieInfo").Begin();
				this.panMovieInfo.Visibility = "Collapsed";
				this.getControl("hide_btnStart").Begin();
				this.StartPanel.Visibility = "Collapsed";
				break;
			}
			case PlayerState.Stopped:   // "Stopped":
			{
				if(!this.isMediaEnded)
				{
					if(this.isOpenMovieList)
					{
						this.getControl("hide_panMovieList").Begin();	
						this.medScreen.height=450;
						this.medScreen["Canvas.Top"]=24;
						this.medScreen.Stretch = "Fill";
						this.isOpenMovieList = false;
					}
					this.imgCapture.visibility = "Visible";
					this.panbuffering.Visibility = "Collapsed";
					if (this.disableArticleInfoPanel == false)
					{
						this.panMovieInfo.Visibility = "Visible";
					}
					this.getControl("hideMovieInfo").Stop();
					this.StartPanel.Visibility = "Visible";
					this.getControl("show_btnStart").Begin();

					this.txtPosition.text = "00:00";
					this.rctDownload.width = 0;
					this.rctProgress.width = 0;
					this.btnProgress["Canvas.Left"] = 0;
				}
				break;
			}
			case PlayerState.Opening:   // "Opening":
			{
				break;
			}
			case PlayerState.Closed:	// "Closed":
			{
				this.medScreen.source = "";
				break;
			}
			default:
			{
				alert("State error. - " + state);
				break;
			}
		}
		
	},
	btnFullScreen_MouseEnter : function(sender, eventArgs) { this.getControl("btnFullscreen_rollover").Begin();this.getControl("BalloonTip_fullscreen").visibility = "Visible";this.getControl("BalloonTip_fullscreen_rollover").Begin(); },
	btnFullScreen_MouseLeave : function(sender, eventArgs) { this.getControl("btnFullscreen_rollover").Stop();this.getControl("BalloonTip_fullscreen_rollout").Begin();this.getControl("BalloonTip_fullscreen").visibility = "Collapsed"; },
	btnFullScreen_MouseLeftButtonDown : function(sender, eventArgs) 
	{
		if (this.playerState == PlayerState.Playing)
		{
			this.control.content.fullscreen = true;
		}
	},
	BrowserHost_FullScreenChange: function(sender, eventArgs)
	{
		var hostContent = sender.getHost().content;
		if (sender.getHost().content.fullscreen == true)	// ÀÏ¹ÝÈ­¸é -> ÀüÃ¼È­¸é
		{
			this.medScreenOriginLeft = this.medScreen["Canvas.Left"];
			this.medScreenOriginTop = this.medScreen["Canvas.Top"];
			this.medScreenOriginWidth = this.medScreen.width;
			this.medScreenOriginHeight = this.medScreen.height;

			this.panPreview.visibility = "Collapsed";
			this.matrial.visibility = "Collapsed";
			this.panEnding.visibility = "Collapsed";
			this.panScrap.visibility = "Collapsed";
			this.panMessage.visibility = "Collapsed";
			this.panController.visibility = "Collapsed";
			this.MovieList_Area.visibility = "Collapsed";
			this.Background.visibility = "Collapsed";

			this.medScreen.Stretch = "Fill";
			this.stretchScreen = true;
			
			this.medScreen["Canvas.Left"] = 0.0;
			this.medScreen["Canvas.Top"] = 0.0;
			this.medScreen.width = hostContent.actualWidth;
			this.medScreen.height = hostContent.actualHeight;
			sender.width = hostContent.actualWidth;
			sender.height = hostContent.actualHeight;
			
			// È­¸é¿¡ ¸Â´Â ¿µ»óÀÌ¶ó¸é ÀüÃ¼È­¸é ¸ðµå¿¡¼­ Ã¤¿ì±â ±â´É È°¼ºÈ­
			if (this.fitScreen == true)
			{
				this.useStretch = true;
				this.medScreen.cursor = "Hand";
			}
		}
		else   // ÀüÃ¼È­¸é -> ÀÏ¹ÝÈ­¸é
		{
			if (this.stretchScreen == true)
			{
				this.medScreen.Stretch = "Fill";
			}
			else
			{
				this.medScreen.Stretch = "None";
			}

			this.medScreen["Canvas.Left"] = this.medScreenOriginLeft;
			this.medScreen["Canvas.Top"] = this.medScreenOriginTop;
			this.medScreen.width = this.medScreenOriginWidth;
			this.medScreen.height = this.medScreenOriginHeight;
			sender.width = this.PageOriginWidth;
			sender.height = this.PageOriginHeight;

			// È­¸é¿¡ ¸Â´Â ¿µ»óÀÌ¶ó¸é ÀüÃ¼È­¸é ÇØÁ¦½Ã Ã¤¿ì±â ±â´É ºñÈ°¼ºÈ­
			if (this.fitScreen == true)
			{
				this.useStretch = false;
				this.medScreen.cursor = "Arrow";
			}

			// Å¬¸®ÇÎ ¿µ¿ª º¹¿ø
			this.root.clip = this.rootClip;
			
			
			this.panPreview.visibility = "Visible";
			this.matrial.visibility = "Visible";
			this.panEnding.visibility = "Visible";
			this.panScrap.visibility = "Visible";
			this.panMessage.visibility = "Visible";
			this.panController.visibility = "Visible";
			this.MovieList_Area.visibility = "Visible";
			this.Background.visibility = "Collapsed";
		}
	},
	btnDownload_MouseEnter : function(sender, eventArgs) 
	{ 
		if(this.isMovieDownload =="1")
		{
			this.getControl("btnDownload_rollover").Begin();this.getControl("BalloonTip_download").visibility = "Visible";this.getControl("BalloonTip_download_rollover").Begin();
		}
		else
		{
			false;
		}
	},
	btnDownload_MouseLeave : function(sender, eventArgs) 
	{
		if(this.isMovieDownload =="1")
		{
			this.getControl("btnDownload_rollover").Stop();this.getControl("BalloonTip_download_rollout").Begin();this.getControl("BalloonTip_download").visibility = "Collapsed";
		}
		else
		{
			false;
		}
	},
	btnDownload_MouseLeftButtonDown : function(sender, eventArgs) { 
		if(this.isMovieDownload =="1")
		{
			document.location.href=this.downloadUrl;
		}
		else
		{
			false;
		}
	},
	btnScrap_MouseEnter : function(sender, eventArgs) { this.getControl("btnScrap_rollover").Begin();this.getControl("BalloonTip_scrap").visibility = "Visible";this.getControl("BalloonTip_scrap_rollover").Begin(); },
	btnScrap_MouseLeave : function(sender, eventArgs) { this.getControl("btnScrap_rollover").Stop();this.getControl("BalloonTip_scrap_rollout").Begin();this.getControl("BalloonTip_scrap").visibility = "Collapsed"; },
	btnScrap_MouseLeftButtonDown : function(sender, eventArgs) 
	{ 
	    if (window.clipboardData) // IE 
        { 
			this.getControl("showScrapPanel").Begin(); 
        }
        else
        {
            alert("ÆÛ°¡±â ±â´ÉÀº ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯¿¡¼­¸¸ Áö¿øµË´Ï´Ù.");
        }
	},
	btnScrapClose_MouseEnter: function(sender, eventArgs) { this.getControl("btnScrapClose_rollover").Begin(); },
	btnScrapClose_MouseLeave: function(sender, eventArgs) { this.getControl("btnScrapClose_rollover").Stop(); },
	btnScrapClose_MouseLeftButtonDown: function(sender, eventArgs) { this.getControl("showScrapPanel").Stop(); },
	btnScrapCopy01_MouseEnter: function(sender, eventArgs) { this.getControl("btnScrapCopy01_rollover").Begin(); },
	btnScrapCopy01_MouseLeave: function(sender, eventArgs) { this.getControl("btnScrapCopy01_rollover").Stop(); },
	btnScrapCopy01_MouseLeftButtonDown: function(sender, eventArgs) 
	{
	    var result = window.clipboardData.setData('Text', this.txtScrapLink1.text);
	    this.getControl("showScrapPanel").Stop();
		this.getControl("showMessagePanel").Begin();
	},
	btnScrapCopy02_MouseEnter: function(sender, eventArgs) { this.getControl("btnScrapCopy02_rollover").Begin(); },
	btnScrapCopy02_MouseLeave: function(sender, eventArgs) { this.getControl("btnScrapCopy02_rollover").Stop(); },
	btnScrapCopy02_MouseLeftButtonDown: function(sender, eventArgs) 
	{
	    var result = window.clipboardData.setData('Text', this.txtScrapLink2.text);
	    this.getControl("showScrapPanel").Stop();
		this.getControl("showMessagePanel").Begin();
	},
	btnMessageConfirm_MouseEnter: function(sender, eventArgs)  { this.getControl("btnMessageConfirm_rollover").Begin(); },
	btnMessageConfirm_MouseLeave: function(sender, eventArgs)  { this.getControl("btnMessageConfirm_rollover").Stop(); },
	btnMessageConfirm_MouseLeftButtonDown: function(sender, eventArgs) 
	{
		this.getControl("showMessagePanel").Stop();
	},
	//Functional Utils
	
	//HTTP µ¿¿µ»ó ´Ù¿î·Îµå ¹ÞÀ»¶§ÀÇ ´Ù¿î·Îµå »óÅÂÇ¥½Ã
	medScreen_DownloadProgressChanged: function(sender, eventArgs)
	{
		if (this.medScreen.downloadProgress == 1.0)
		{
			this.downloadRate = this.medScreen.downloadProgress;
			this.rctDownload.width = (this.panProcessbar.Width) * this.downloadRate -2;
			this.counter1 = 0;
		}
		this.counter1++;
	},
	setProgressbar: function()
	{
		var progress = (this.panProcessbar.Width) * this.medScreen.position.seconds / this.duration;
		this.rctProgress.width = progress;
		if (this.btnProgressMouseDown == false)
		{
			this.btnProgress["Canvas.Left"] = this.progressButtonBase + progress;
			if(this.btnProgress["Canvas.Left"] < 0) { this.btnProgress["Canvas.Left"] = 0; }
			if(this.btnProgress["Canvas.Left"] > this.panProcessbar.Width-this.btnProgress.Width) { this.btnProgress["Canvas.Left"] = this.panProcessbar.Width - this.btnProgress.Width+4 }
		}
	},
	// btnProgress: Àç»ý ÇÁ·Î±×·¡½º¹ÙÀÇ ½½¶óÀÌ´õ ----------------------------------------------------------------------------------
	btnProgress_MouseLeftButtonDown: function(sender, eventArgs)
	{
		// Àç»ý, ÀÏ½ÃÁ¤Áö, ÁßÁö »óÅÂ¿¡¼­¸¸ ½½¶óÀÌ´õ ÀÌµ¿ °¡´É
		if (this.playerState != PlayerState.Playing &&
			this.playerState != PlayerState.Paused &&
			this.playerState != PlayerState.Stopped)
		{
			return;
		}
		
		// Àç»ý ¿Ï·á ÆÇ³Ú Ä¡¿ì±â
		this.getControl("showEndingPanel").Stop();

		this.btnProgress.captureMouse();
		
		this.btnProgressMouseDown = true;
		
		this.btnProgressX = eventArgs.getPosition(this.panProcessbar).x - this.btnProgress["Canvas.Left"];
	},
	moveMoviePosition: function(newPosition)
	{
		var timeSpan = this.medScreen.position;
		timeSpan.seconds = newPosition;
		var state = this.medScreen.currentState;
		
		this.medScreen.pause();
		this.medScreen.position = timeSpan;
		
		if (state == PlayerState.Playing)
		{
			this.medScreen.play();
		}
		else if (state == PlayerState.Stopped)
		{
			this.medScreen.pause();
		}
	},
	btnProgress_MouseLeftButtonUp: function(sender, eventArgs)
	{
		if (this.btnProgressMouseDown == false)
		{
			return;
		}
		
		this.btnProgress.releaseMouseCapture();
		this.btnProgressMouseDown = false;
		var newPosition = this.duration * this.btnProgress["Canvas.Left"] / this.progressWidth;
		this.moveMoviePosition(newPosition)
	},

	btnProgress_MouseMove: function(sender, eventArgs)
	{
		if (this.btnProgressMouseDown == false)
		{
			return;
		}
		
		var newLeft = eventArgs.getPosition(this.panProcessbar).x - this.btnProgressX;
		
		// ÇÁ·Î±×·¡½º ¹öÆ°(½½¶óÀÌ´õ) ¹üÀ§ Á¦ÇÑ
		if (newLeft < this.progressButtonBase)
		{
			newLeft = this.progressButtonBase;
		}
		else if (newLeft > this.progressButtonBase + this.btnProgressArea.width - this.btnProgress.Width + 10)
		{
			newLeft = this.progressButtonBase + this.btnProgressArea.width - this.btnProgress.Width + 10 ;
		}
		
		this.btnProgress["Canvas.Left"] = newLeft;
	},
	
	// ÇÁ·Î±×·¡½º¹Ù¸¦ Á÷Á¢ Å¬¸¯
	rctBackground_MouseLeftButtonDown: function(sender, eventArgs)
	{
		// Àç»ý, ÀÏ½ÃÁ¤Áö, ÁßÁö »óÅÂ¿¡¼­¸¸ ÀÌµ¿ °¡´É
		if (this.playerState != PlayerState.Playing &&
			this.playerState != PlayerState.Paused &&
			this.playerState != PlayerState.Stopped)
		{
			return;
		}
		
		// Àç»ý ¿Ï·á ÆÇ³Ú Ä¡¿ì±â
		this.getControl("showEndingPanel").Stop();
		var newPosition = this.duration * (eventArgs.getPosition(this.panProcessbar).x) / this.panProcessbar.Width;
		if (newPosition < 0)
		{
			newPosition = 0;
		}
		else if (newPosition > this.duration)
		{
			newPosition = this.duration;
		}
		this.moveMoviePosition(newPosition);
	},	
	btnReplay_MouseEnter: function(sender, args){ this.getControl("btnReplay_rollover").Begin(); },
	btnReplay_MouseLeave: function(sender, args){ this.getControl("btnReplay_rollover").Stop(); },
	btnReplay_MouseLeftButtonDown: function(sender, args){ this.playMovie(); },
	btnOtherMovie_MouseEnter: function(sender, args){ this.getControl("btnOtherMovie_rollover").Begin(); },
	btnOtherMovie_MouseLeave: function(sender, args){ this.getControl("btnOtherMovie_rollover").Stop(); },
	btnOtherMovie_MouseLeftButtonDown: function(sender, args){
		window.open(this.strChannelURL, "movie_channel");
	},
	panAdvertisement_MouseLeftButtonDown :function(sender, eventArgs)
	{
		if(this.adTextLinkType =="2")
		{
			window.open(this.adTextLink);
		}
		else if(this.adTextLinkType =="1")
		{
			document.location.href = this.adTextLink;
		}
	},

	timer_Completed: function(sender, eventArgs)
	{
		var medPosition = this.medScreen.position.seconds
		var strPosition = secondsToString(medPosition)
		this.txtPosition.text = strPosition;
		if (this.counter2 >= 3)
		{
			this.setProgressbar();
			this.counter2 = 0;
		}
		this.counter2++;
		if(this.textAdCount || this.textAdCount == 0)
		{
			for (var j = 0 ; j< this.textAdArray.length;j++)
			{
				if(this.textAdCount == "a" & !this.isShowTextAd & medPosition >= parseInt(this.textAdArray[j].startTime) && medPosition <= parseInt(this.textAdArray[j].endTime) )
				{
					this.txtMessage.text = this.textAdArray[j].title;
					this.adTextLink = this.textAdArray[j].linkUrl;
					this.adTextLinkType = this.textAdArray[j].linkTarget;
					this.getControl("show_ad").Begin();
					this.isShowTextAd = true;
					this.textAdCount = j;
				}
				else if(j == this.textAdCount & this.isShowTextAd & medPosition > parseInt(this.textAdArray[j].endTime))
				{
					this.textAdCount = "a";
					this.txtMessage.text = "";
					this.getControl("hide_ad").Begin();
					this.adTextLink = "";
					this.isShowTextAd = false;
				}
			}
		}
		if (this.medScreen.currentState == PlayerState.Playing ||
			this.medScreen.currentState == PlayerState.Paused)
		{
			this.timer.begin();
		}
	},
	canvasRoot_MouseLeave: function(sender, eventArgs)
	{
		this.medScreen_MouseEnter();
		this.btnProgressMouseDown = false;
	},

	canvasRoot_KeyDown: function(sender, eventArgs)
	{
		switch (eventArgs.Key)
		{
			case 3: // Enter
			{
				this.btnFullScreen_MouseLeftButtonDown(this.btnFullScreen, null);
				break;
			}
			case 9: // Space
			{
				if (this.btnPlay.visibility == "Visible")		   // Àç»ý ¹öÆ°
				{
					this.playMovie();
				}
				else if (this.btnPause.visibility == "Visible")	 // ÀÏ½ÃÁ¤Áö ¹öÆ°
				{
					this.btnPause_MouseLeftButtonDown(this.btnPlay, null);
				}
				break;
			}
			default:
			{
				break;
			}
		}
	},
	// °Ô½Ã¹° Á¤º¸ xaml ·Îµù ÄÝ¹é
    ArticleXMLLoadComplete: function()
    {
        if (this.httpRequest1.readyState == 4)
        {
            if (this.httpRequest1.status == 200)
            {
                var xmlDoc = this.httpRequest1.responseXML;
				closeRequest(this.httpRequest1);
                var errorCodeList = xmlDoc.getElementsByTagName("frk_n4ErrorCode");
				if(errorCodeList.length==0) {return;}
                var errorCode = errorCodeList[0].firstChild.nodeValue;
                if (errorCode != "0")
                {
                    var errorMessageList = xmlDoc.getElementsByTagName("frk_strErrorText");
                    var errorMessage = errorMessageList[0].firstChild.nodeValue;
                    this.txtSubScription.text =  "<°Ô½Ã¹° Á¤º¸¸¦ °¡Á®¿ÀÁö ¸øÇß½À´Ï´Ù>";
                    return;
                }
                
                var articleList = xmlDoc.getElementsByTagName("ArticleInfo");
				if(articleList.length ==0)
				{
					articleList =  xmlDoc.getElementsByTagName("ApplyInfo");
					this.isPastXML = true;
				}
                var article = articleList[0];
                for (var i = 0; i < article.childNodes.length; i++)
                {
					var childNode = article.childNodes[i];
                    var err = false;
                    try
                    {
                        switch (childNode.nodeName)
                        {
                            case "strArticleTitle":
                            {
                                this.strArticleTitle = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"Á¦¸ñ Á¤º¸°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
                                break;
                            }
                            case "Category":
                            {
                                this.category = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"");
                                break;
                            }
                            case "strNickName":
                            {
                                this.strNickName = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"nexon");
                                break;
                            }
                            case "strMovieFileURL":
                            {
                                this.strMovieFileURL = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"#");
                                break;
                            }
							case "codeComicAuthor":
							{
								this.codeComicAuthor = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"1");
								break;
							}
							case "codeMovieAuthor":
							{
								this.codeMovieAuthor = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"1");
								break;
							}
                            case "dateCreate":
                            {
                                this.dateCreate = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"2009-01-01");
                                break;
                            }
                            case "strArticleURL":
                            {
                                this.strArticleURL = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"#");
                                break;
                            }
                            case "strChannelURL":
                            {
                                this.strChannelURL = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"#");
                                break;
                            }
							case "n4ReadCount":
							{
								this.n4ReadCount = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"0");
                                break;
							} 
							case "n4RecommandCount":
							{
								this.n4RecommandCount = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"0");
                                break;
							} 
							case "n4RecommandPoint":
							{
								this.n4RecommandPoint = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"0");
                                break;
							} 
							case "isMovieDownload":
							{
								this.isMovieDownload = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"0");
                                break;
							} 
							
                            default:
                            {
                                break;
                            }
                        }// switch
                    }
                    catch (e)
                    {
                        err = true;
                        break;
                    }
                }// for
				
				if(this.strArticleTitle =="")
				{
					this.btnOpenMovieList.Visibility = "Collapsed";
					this.panMovieInfo.Visibility = "Collapsed";
					this.panRecommendPanel.Visibility = "Collapsed";
					this.btnOtherMovie.Visibility = "Collapsed";
					this.disableArticleInfoPanel = true;
					this.disableOtherMovieButton = true;
					this.btnReplay["Canvas.Left"] = 204;
					this.btnReplay["Canvas.Top"] = 210;
					return;
				}
				if(this.category != "" && this.ableCategory != "")
				{
					if(this.ableCategory =="all")
					{
						this.isShowStartLogo = true;
					}
					else
					{
						var ableCateList = this.ableCategory.split(",");
						if(ableCateList.length!=0)
						{	
							for(var q = 0; q<ableCateList.length;q++)
							{
								if(ableCateList[q] == this.category) {this.isShowStartLogo = true;}
							}
						}
					}
				}
				if(this.strChannelURL=="")
				{
					this.btnOtherMovie.Visibility = "Collapsed";
					this.btnReplay["Canvas.Left"] = 204;
					this.btnReplay["Canvas.Top"] = 210;
				}
				if(this.n4ReadCount=="")
				{
					this.getControl("titleLine").Visibility = "Collapsed";
					this.getControl("txtHitT").Visibility = "Collapsed";
				}
				if(this.disableScrapButton||this.strArticleURL =="")
				{
					this.disableScrapButton= true;
					this.btnScrap.cursor = "Arrow";
					this.btnScrap.opacity = 0.5;
				}

				if(!this.codeComicAuthor && !this.codeMovieAuthor)
				{
					this.getControl("ComicAuthorIcon").Source ="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/level/ico_common.png";
				}
				else if(this.codeComicAuthor == "1" && this.codeMovieAuthor == "1")
				{
					this.getControl("ComicAuthorIcon").Source ="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/level/ico_common.png";
				}
				else
				{
					switch (this.codeComicAuthor)
					{
						case "2":
						{
							this.getControl("ComicAuthorIcon").Source ="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/level/lv_c_a.png";
							break;
						}
						case "3":
						{
							this.getControl("ComicAuthorIcon").Source ="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/level/lv_c_p.png";
							break;
						}
					}// switch
					switch (this.codeMovieAuthor)
					{
						case "2":
						{
							this.getControl("MovieAuthorIcon").Source ="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/level/lv_m_a.png";
							break;
						}
						case "3":
						{
							this.getControl("MovieAuthorIcon").Source ="http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/level/lv_m_p.png";
							break;
						}
					}// switch
				}
				if(this.getControl("ComicAuthorIcon").Source =="")
				{
					this.getControl("MovieAuthorIcon")["Canvas.Left"] = 0;
					this.getControl("panTextMovieInfo")["Canvas.Left"] = 37;
				}
				if(this.getControl("MovieAuthorIcon").Source =="")
				{
					this.getControl("panTextMovieInfo")["Canvas.Left"] = 37;
				}
				if(this.isPastXML)
				{
					this.getControl("txtStarT").Visibility = "Collapsed";
					this.getControl("panStarScore").Visibility = "Collapsed";
				}
				else if(this.n4RecommandPoint=="0"||this.n4RecommandCount=="0")
				{
					this.rctStarScoreProgress.Width = 0;
				}
				else
				{
					this.rctStarScoreProgress.Width = (parseInt(this.n4RecommandPoint) / parseInt(this.n4RecommandCount) ) * 12.2;
				}
				var otherArticleLength ="";
				if(this.isPastXML){otherArticleLength= 0;}
				else{otherArticleLength = xmlDoc.getElementsByTagName("n4NextArticleCount")[0].firstChild.nodeValue;}
				if(otherArticleLength > 0)
				{
					this.otherMovieList = new Array();
					var otherMovieXmlList = xmlDoc.getElementsByTagName("NextArticleList")[0].getElementsByTagName("NextArticleInfo");
					for(var i=0;i<otherArticleLength;i++)
					{
						var tempTitObj = otherMovieXmlList[i].getElementsByTagName("strArticleTitle")[0].firstChild;
						var tempThumbObj = otherMovieXmlList[i].getElementsByTagName("strThumbnailURL")[0].firstChild;
						var tempURLObj = otherMovieXmlList[i].getElementsByTagName("strArticleURL")[0].firstChild;
						
						this.otherMovieList[i] = new RecommandMovie( 
							tempTitObj != null ? tempTitObj.nodeValue : "Á¦¸ñ Á¤º¸°¡ Á¸Àç ÇÏÁö¾Ê½À´Ï´Ù.",
							tempThumbObj != null ? tempThumbObj.nodeValue : "http://s.nx.com/s2/Portal/Nexon/Nexon2007/image/global/basic_setsilverlight.png",
							tempURLObj != null ? tempURLObj.nodeValue : "#");
					}
					try
					{
						this.img11.source = this.otherMovieList[0].thumbnailURL;
						this.txtTitle11.text = this.otherMovieList[0].title;
						this.img12.source = this.otherMovieList[1].thumbnailURL;
						this.txtTitle12.text = this.otherMovieList[1].title;
						this.img13.source = this.otherMovieList[2].thumbnailURL;
						this.txtTitle13.text = this.otherMovieList[2].title;
						this.img14.source = this.otherMovieList[3].thumbnailURL;
						this.txtTitle14.text = this.otherMovieList[3].title;
						this.img15.source = this.otherMovieList[4].thumbnailURL;
						this.txtTitle15.text = this.otherMovieList[4].title;
						this.img16.source = this.otherMovieList[5].thumbnailURL;
						this.txtTitle16.text = this.otherMovieList[5].title;
					}
					catch (e)
					{
						return;
					}
				}
				else
				{
						this.btnMovieList.visibility = "Collapsed";
						this.btnOpenMovieList.visibility = "Collapsed";
				}
				
				if(this.isMovieDownload =="1")
				{
					var oidFileUrl = this.userContext.movieURL;
					
					var startIndex = oidFileUrl.indexOf("?oidFile=") + 9;
					var resultOidFile = oidFileUrl.substring(startIndex);
					var endIndex = "";
					var reg=/[^0-9]/gi;
					if( resultOidFile.search(reg) != "-1" )
					{
						var endIndex = resultOidFile.search(reg);
						resultOidFile = resultOidFile.substring(0,endIndex)
					}
					this.downloadUrl = "/NxFile/Download/MovieFileDownloader.aspx?oidFile="+resultOidFile;
				}
				else
				{
					this.btnDownload.opacity = 0.5;
				}
                
				
                if (err == false)
                {
					this.txtSubScription.text =  this.strArticleTitle;
					this.txtAuthor.text =  this.strNickName;
					this.getControl("textMovieInfoAdd")["Canvas.Left"] = this.txtAuthor["Canvas.Left"] + this.txtAuthor.ActualWidth + 40;
					this.txtWrittenDate.text =  this.dateCreate;
					this.txtHitCount.text =  this.n4ReadCount;
                }
                
				this.scrabLink1 = '<div style="padding:11px 0 0 11px;width:422px;height:355px;background:url(http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/global/img_nexonplay1.gif) no-repeat left top"><a href="' + this.strArticleURL + '"><img width="400" height="300" border="0" src="http://'+ document.domain + this.strThumbnailURL + '" /></a> </div>';
                this.scrabLink2 = this.strArticleURL;
                
                this.getControl("txtScrapLink1").text = this.scrabLink1;
                this.getControl("txtScrapLink2").text = this.scrabLink2;
				var textAdDom = xmlDoc.getElementsByTagName("TextBannerList");
				if(textAdDom.length > 0)
				{
	                var textAdLength = textAdDom[0].getElementsByTagName("n4TextBannerCount")[0].firstChild.nodeValue;
					var textAdXmlList = textAdDom[0].getElementsByTagName("Banner");
					if(textAdLength > 0)
					{
						this.textAdArray = new Array();
						for(var i=0;i<textAdLength;i++)
						{
							this.textAdArray[i] = new textAd(
								textAdXmlList[i].getElementsByTagName("strTitle")[0].firstChild.nodeValue,
								textAdXmlList[i].getElementsByTagName("n4StartTime")[0].firstChild.nodeValue,
								textAdXmlList[i].getElementsByTagName("n4PlayTime")[0].firstChild.nodeValue,
								parseInt(textAdXmlList[i].getElementsByTagName("n4StartTime")[0].firstChild.nodeValue)+
								parseInt(textAdXmlList[i].getElementsByTagName("n4PlayTime")[0].firstChild.nodeValue),
								textAdXmlList[i].getElementsByTagName("strLink")[0].firstChild.nodeValue,
								textAdXmlList[i].getElementsByTagName("codeLinkTarget")[0].firstChild.nodeValue);
						}
						this.textAdCount = "a";
					}
				}
				var endingAdDom = xmlDoc.getElementsByTagName("EndingBannerList");
				if(endingAdDom.length > 0)
				{
	                var endingAdLength = endingAdDom[0].getElementsByTagName("n4EndingBannerCount")[0].firstChild.nodeValue;
					var endingAdXmlList = endingAdDom[0].getElementsByTagName("Banner");
					if(endingAdLength > 0)
					{
						this.endingAdArray = new Array();
						for(var i=0;i<endingAdLength;i++)
						{
							this.endingAdArray[i] = new endingAd(
								endingAdXmlList[i].getElementsByTagName("strFileURL")[0].firstChild.nodeValue.trim(),
								endingAdXmlList[i].getElementsByTagName("strLink")[0].firstChild.nodeValue.trim(),
								endingAdXmlList[i].getElementsByTagName("codeLinkTarget")[0].firstChild.nodeValue);
						}
						this.isEndingMovie = true;
						this.endingCount = 0;
					}
				}
            }// if
        }// if
		else { return false; }
    },

    // ÃßÃµ¿µ»ó Á¤º¸ xml ÄÝ¹é
    RecommandXMLLoadComplete: function()
    {
        if (this.httpRequest2.readyState == 4)
        {
            if (this.httpRequest2.status == 200)
            {
                var xmlDoc = this.httpRequest2.responseXML;
				closeRequest(this.httpRequest2);
                var errorCodeList = xmlDoc.getElementsByTagName("frk_n4ErrorCode");
                var errorCode = errorCodeList[0].firstChild.nodeValue;
                if (errorCode != "0")
                {
                    var errorMessageList = xmlDoc.getElementsByTagName("frk_strErrorText");
                    var errorMessage = errorMessageList[0].firstChild.nodeValue;
                    alert(errorMessage);
                    return;
                }
                var applyList = xmlDoc.getElementsByTagName("ApplyInfo");
                this.recommand = new MovieList();
                
                for (var j = 0; j < applyList.length; j++)
                {
                    
                    var apply = applyList[j];
                    var strThumbnailURL = "";
                    var strArticleURL = "";
                    
                    for (var i = 0; i < apply.childNodes.length; i++)
                    {
                        var childNode = apply.childNodes[i];
                        var err = false;
                        try
                        {
                            switch (childNode.nodeName)
                            {
                                case "strThumbnailURL":
                                {
                                    strThumbnailURL = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"http://s.nx.com/s2/Portal/Nexon/Nexon2007/image/global/basic_setsilverlight.png");
                                    break;
                                }
                                case "strArticleURL":
                                {
                                    strArticleURL = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"#");
                                    break;
                                }
                                case "strArticleTitle":
                                {
                                    strArticleTitle = XMLDecode(childNode.firstChild != null ? childNode.firstChild.nodeValue:"Á¦¸ñ Á¤º¸°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
                                    break;
                                }
                                default:
                                {
                                    break;
                                }
                            }// switch
                        }
                        catch (e)
                        {
                            err = true;
                            break;
                        }
                    }// for
                    
                    // ¿¹¿Ü°¡ ¹ß»ýÇÑ Ç×¸ñÀº Ãß°¡ ¾ÈÇÔ
                    if (err == false)
                    {
                        this.recommand.addMovie(strArticleTitle, strThumbnailURL, strArticleURL);
                    }
                }// for
                
                this.recommand.index = 0;
                
                if (this.recommand.getLength() == 0)
                {
                    this.disableMovieListPanel = true;
                    this.getControl("panMovieList").visibility = "Collapsed";
                }
                else
                {
                    this.setMovieList();
                }
            }// if
        }// if
		else { return false; }
    },
    setMovieList: function()
    {
        this.movThumb01 = this.recommand.getMovie();
        this.movThumb02 = this.recommand.getMovie();
        this.movThumb03 = this.recommand.getMovie();

        this.txtMovieTitle31.text = this.movThumb01.title;
		this.img31.source = this.movThumb01.thumbnailURL;
        this.txtMovieTitle32.text = this.movThumb02.title;
		this.img32.source = this.movThumb02.thumbnailURL;
        this.txtMovieTitle33.text = this.movThumb03.title;
		this.img33.source = this.movThumb03.thumbnailURL;
    },
	//Find Object
	getControl: function(name) { return this.control.content.findName(name); },
	addControlHandler: function(name, event, handler) { this.getControl(name).addEventListener(event, Silverlight.createDelegate(this, handler)); }
}




function Invalid(value)
{
	return (value == undefined || value == null || value == "");
}
function URLDecode(strEncode) 
{
	var isRegExp = /\ + /g;
	return unescape(String(strEncode).replace(isRegExp,"")); 
}
function GetElements(obj)
{
	var ret = "";
	for(var each_pro in obj)
	{
		ret += each_pro + "\r\n"; // + "=" + obj[each_pro] + "\r\n";
	}
	return ret;
}
function XMLEncode(strEncode)
{
	var temp = strEncode;
	temp = temp.replace("&", "&amp;");  // ¼ø¼­ ÁÖÀÇ!!
	temp = temp.replace("<", "&lt;");
	temp = temp.replace(">", "&gt;");
	temp = temp.replace("'", "&apos;");
	temp = temp.replace('"', "&quot;");
	return temp;
}
function XMLDecode(strEncode)
{
	var temp = strEncode;
	temp = temp.replace("&lt;", "<");
	temp = temp.replace("&gt;", ">");
	temp = temp.replace("&apos;", "'");
	temp = temp.replace("&quot;", '"');
	temp = temp.replace("&amp;", "&");  // ¼ø¼­ ÁÖÀÇ!!
	return temp;
}


function sendRequest(httpRequest, URL, params, callback, method) 
{
	var httpMethod = method ? method : 'GET';

	if (httpMethod != 'GET' && httpMethod != 'POST') 
	{
		httpMethod = 'GET';
	}

	var httpParams = (params == null || params == '') ? null : params;
	var httpUrl = URL;

	if (httpMethod == 'GET' && httpParams != null) 
	{
		httpUrl = httpUrl + "?" + httpParams;
	}
	
	try
	{
		httpRequest.open(httpMethod, httpUrl, true);
	}
	catch (e)
	{
		alert("HttpRequest°´Ã¼ ¿À·ù \r\nOpen ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.");
		this.failRequest = false;
		return this.failRequest;
	}
	httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=ks_c_5601-1987');
	httpRequest.setRequestHeader('Cache-Control', 'no-cache');
	httpRequest.onreadystatechange = callback;
	httpRequest.send(httpMethod == 'POST' ? httpParams : null);	
	return httpRequest;	
}

function closeRequest(httpRequest) {
	httpRequest.onreadystatechange = function() { };
	httpRequest.abort();
	delete request;
}


function getXMLHttpRequest() {
	if( window.ActiveXObject )
	{
		try { return new ActiveXObject( 'Msxml12.XMLHTTP' ); } 
		catch( e ) 
		{
			try { return new ActiveXObject( 'Microsoft.XMLHTTP' ); } 
			catch (e2) { return new XMLHttpRequest(); }	// IE 7.0 
		}
	} 
	else { return new XMLHttpRequest(); }
}
String.prototype.trim = function() 
{
	return this.replace(/^\s+|\s+$/g,"");
}
function HandleLoadFile( responseText, objReturn )//, aaa 
{
	var wmpID = objReturn.request.wmpID;
	if ( wmpID != '' )
	{
		MP = new MediaPlayer();
		MP.ClientID		= wmpID;
		MP.n4Width 		= 600;
		MP.n4Height 	= 448;		
		MP.ParentID		= objReturn.request.parentID;
		MP.strFileFullPath = unescape(objReturn.response.url);
		
		if ( NgbBrowser.msie() )		
			document.getElementById( wmpID ).url = unescape(objReturn.response.url);
		else
			document.getElementById( MP.ParentID ).innerHTML = MP.Write();

		MP.versionCheck( MP.ClientID );
	}
}

function silverlightInstallLog ( param )
{
	try
	{
		var logTarget = new __NgbAjaxRequest( '/common/wiselog/addlog.aspx' );
		logTarget.AddQueryString( 'Silverlight',  param );
		logTarget.AddHandler( HandleSilverlightInstallLog );
		logTarget.ExecuteAml();
	}
	catch(e)
	{
		return;
	}
}

function HandleSilverlightInstallLog ()
{
	return false;
}

function checkInstallFunc() {
	if(Silverlight.isInstalled('1.0.21115'))
	{
		silverlightInstallLog("InstallComplete");
		location.reload();
	}
}
function secondsToString(seconds)
{
	var datetime = new Date(0, 0, 0, 0, 0, seconds)

	var min = datetime.getMinutes();
	var sec = datetime.getSeconds();

	if (sec < 10) {sec = "0" + sec;}
	if (min < 10) {min = "0" + min;}

	return min + ":" + sec;
}
function stringToSeconds(text)
{
	var timeArray = text.split(":");
	if( timeArray.length == 2 )
	{
		return parseInt(timeArray[0],10)*60 + parseInt(timeArray[1],10);
	}
	else
	{
		alert("illegal type");
		return "no data";
	}
}


function RecommandMovie(title, thumbnailURL, articleURL)
{
    this.title = title;
    this.thumbnailURL = thumbnailURL;
    this.articleURL = articleURL;
}
function endingAd(movieUrl, linkUrl, linkTarget)
{
	this.movieUrl = movieUrl;
	this.linkUrl = linkUrl;
	this.linkTarget = linkTarget;
}
function textAd(title, startTime, playTime, endTime, linkUrl, linkTarget)
{
	this.title = title;
	this.startTime = startTime;
	this.playTime = playTime;
	this.endTime = endTime;
	this.linkUrl = linkUrl;
	this.linkTarget = linkTarget;
}

function MovieList()
{
    this.list = new Array();
    this.index = 0;
}

MovieList.prototype = 
{
    addMovie: function(title, thumbnailURL, articleURL)
    {
        this.list[this.index] = new RecommandMovie(title, thumbnailURL, articleURL);
        this.index++;
    },
    
    getLength: function()
    {
        return this.list.length;
    }, 
    
    IncreaseIndex: function(inc)
    {
        if (this.list.length <= 0) return null;
        this.index += inc;
        while (this.index < 0) this.index += this.list.length;
        while (this.index >= this.list.length) this.index -= this.list.length;
    },
    
    getMovie: function()
    {
        if (this.list.length <= 0) return null;
        while (this.index >= this.list.length) this.index -= this.list.length;
        return this.list[this.index++];
    }
}

function HandleLoadFile2( obj, url )//, aaa 
{
	if ( obj.strFileFullPath != "undefined" ) obj.strFileFullPath = url;
}

function MediaPlayer()
{
	this.ClientID			= null;
	this.ParentID			= null;
	this.n4Width			= 600;
	this.n4Height			= 448;
	this.strFileFullPath	= "1";
	this.strStyle			= "margin:0;border-width:0;border-color:white;border-style:inset";
	this.strClassName		= null;	
	this.ajaxMovieURL		= "/NxFile/Download/MovieAmlDownloader.aspx";	
			
	this.MediaPlayer		= MediaPlayer;	
	
	this.Write = function ()
	{
		var thisStyle	= ( this.strStyle != null ) ? "style='" + this.strStyle + "'" : "";
		var thisClass	= ( this.strClassName != null ) ? "class='" + this.strClassName + "'" : "";
		var returnWrite = "";
		returnWrite +=  "<object classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6' width='" + this.n4Width + "' height='" + this.n4Height + "' id='" + this.ClientID + "' " + thisStyle + " " + thisClass + " standby='Loading Microsoft Windows Media Player components...'>";
		returnWrite +=  "<param name='url' value='" + this.strFileFullPath + "'>";
		//returnWrite +=  "<param name='SAMIFilename' value='test.smi'>";
		returnWrite +=  "<param name='ShowCaptioning' value='0'>";
		returnWrite +=  "<param name='AutoStart' value='0'>";
		returnWrite +=  "<param name='AutoRewind' value='0'>";
		returnWrite +=  "<param name='showcontrols' value='1'>";
		returnWrite +=  "<param name='AutoRestart' value='0'>";
		returnWrite +=  "<param name='ShowDisplay' value='0'>";
		returnWrite +=  "<param name='EnableContextMenu' value='0'>";
		returnWrite +=  "<param name='ShowPositionControls' value='0'>";
		returnWrite +=  "<param name='ShowStatusBar' value='0'>";
		returnWrite +=  "<!-- Hixie method -->";
		returnWrite +=  "<!--[if !IE]> <-->";
		returnWrite +=  "	<object type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' data='" + this.strFileFullPath + "' width='" + this.n4Width + "' height='" + this.n4Height + "' id='" + this.ClientID + "notIE' " + thisStyle + " " + thisClass + "></object>";
		returnWrite +=  "<!--> <![endif]-->";
		returnWrite +=  "</object>" ;
		return returnWrite;
	}
	this.LoadFile = function ( oidFile , wmpID , oidBoard , oidArticle, parentID )
	{
		var objAjax_File = new __NgbAjaxRequest( this.ajaxMovieURL );
		objAjax_File.AddQueryString( 'oidFile',  oidFile );
		objAjax_File.AddQueryString( 'wmpID',  wmpID );
		objAjax_File.AddQueryString( 'oidBoard',  oidBoard );
		objAjax_File.AddQueryString( 'oidArticle',  oidArticle );
		objAjax_File.AddQueryString( 'parentID',  parentID );
		objAjax_File.AddHandler( HandleLoadFile );
		objAjax_File.ExecuteAml();
	}
	this.versionCheck = function(ClientID)
	{
		try
		{
			if(document.getElementById(ClientID).versionInfo)
			{
				var mpVer = document.getElementById(ClientID).versionInfo.split(".");
				var mpVer = mpVer[0];
				if(parseInt(mpVer) < 9)
				{
					if(confirm("µ¿¿µ»óÀ» °¨»óÇÏ±â À§ÇØ¼­´Â Microsoft Window Media Player ¹öÀü9 ÀÌ»óÀÌ ¼³Ä¡ µÇ¾î¾ß ÇÕ´Ï´Ù.\n¼³Ä¡ ÇÏ½Ã°Ú½À´Ï±î?"))
					{
						window.open("http://download.microsoft.com/download/1/b/c/1bc0b1a3-c839-4b36-8f3c-19847ba09299/MPSetup.exe");
					}
				}
			}
		}
		catch(e)
		{
			if(confirm("µ¿¿µ»óÀ» °¨»óÇÏ±â À§ÇØ¼­´Â Microsoft Window Media Player ¹öÀü9 ÀÌ»óÀÌ ¼³Ä¡ µÇ¾î¾ß ÇÕ´Ï´Ù.\n¼³Ä¡ ÇÏ½Ã°Ú½À´Ï±î?"))
			{
				window.open("http://download.microsoft.com/download/1/b/c/1bc0b1a3-c839-4b36-8f3c-19847ba09299/MPSetup.exe");
			}
		}
	}
}
