// JavaScript Document
	
	function Player(objName, section)
	{
		this.objName 		= objName;
		this.section 		= section;
		this.mediaID 		= "";
		this.mediaType 		= "";
		this.mediaLink 		= "";	
		this.dataSpeed 		= "";
		this.version 		= "";
		this.browser 		= "";

		this.container 		= "";
		this.settingPanel 	= "";
		this.playerPanel 	= "";
		this.player 		= "";

		this.setMediaID 	= setMediaID;
		this.setMediaType 	= setMediaType;
		this.setDataSpeed 	= setDataSpeed;
		this.setPlayer 		= setPlayer;
		this.chkVersion 	= chkVersion;
		this.chkDataSpeed 	= chkDataSpeed;
		this.initPlayer 	= initPlayer;
		this.showSettingPanel = showSettingPanel;
		this.hideSettingPanel = hideSettingPanel;
		this.xmlhttpPost	= xmlhttpPost;
		this.showPlayer		= showPlayer;
	}
	
	function setMediaID(id)
	{
		this.mediaID = id;	
	}
	
	function setMediaType(type)
	{
		this.mediaType = type;	
	}
	
	function setDataSpeed(speed)
	{
		register(speed);
		this.dataSpeed = speed;
		this.hideSettingPanel();
		this.xmlhttpPost("/player/"+this.section+"/wmp/"+this.dataSpeed+"/"+this.version+"/"+this.mediaID+"/", "", this.objName+".showPlayer");		
	}
	
	function showPlayer(str)
	{
		this.playerPanel.innerHTML = str;
		this.playerPanel.style.display = "block";
	}
	
	function chkVersion()
	{
		var playObj;
		var browser;
		if ( navigator.appName != "Netscape" ){
			playObj = new ActiveXObject('WMPlayer.OCX');
		}

		if (playObj)
		{
			this.version= 1;
		}
		else
		{
			this.version = 2;
		}
	}
	
	function showSettingPanel()
	{
		this.playerPanel.innerHTML = "";
		this.playerPanel.style.display = "none";
		this.settingPanel.style.display = "block";
	}
	
	function hideSettingPanel()
	{
		this.settingPanel.style.display = "none";
		this.playerPanel.style.display = "block";		
	}	

	function chkDataSpeed()
	{
/*		switch(GetCookie("dataSpeed"))
		{
			case "low":
				this.dataSpeed = "low";
				returnValue = true;
				break;
			case "high":
				this.dataSpeed = "high";
				returnValue = true;
				break;
			default :
				returnValue = false;
		}
*/		this.dataSpeed = 'high'
		returnValue = true;
		return returnValue;
	}
	
	
	function register(value) { 
		var today = new Date();
		var expire = new Date(today.getTime() + 60*60*24*31*1000);
		SetCookie("dataSpeed", value, expire, "/", "goodnewsline.com");
	}
	
	function setPlayer(){}
	
	function initPlayer(mediaID)
	{
		this.setMediaID(mediaID);
		this.chkVersion();
		this.container = document.getElementById("playerContainer");
		this.playerPanel = document.getElementById("playerPanel");
		this.settingPanel = document.getElementById("settingPanel");	

		btn = document.getElementById("settingBtn");
		eval(' btn.onclick = function (){'+ this.objName +'.showSettingPanel();}');
		objLow = document.getElementById("speedLow");
		objHigh = document.getElementById("speedHigh");
		eval('objLow.onclick = function (){'+this.objName+'.setDataSpeed("low");};');
		eval('objHigh.onclick = function (){'+this.objName+'.setDataSpeed("high");};');

		if (this.chkDataSpeed())
		{
			this.hideSettingPanel();
			this.xmlhttpPost("/player/"+this.section+"/wmp/"+this.dataSpeed+"/"+this.version+"/"+this.mediaID+"/", "", this.objName+".showPlayer");
		}else{
			this.showSettingPanel();
		}
	}